protected void gridView_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "Number") { e.Value = string.Format("{0}", e.ListSourceRowIndex + 1); } }
protected void grdProducts_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "Total") { decimal price = (decimal)e.GetListSourceFieldValue("UnitPrice"); int quantity = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock")); e.Value = price * quantity; } }
protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "CompositeKey") { //Compose a primary key value string firstName = Convert.ToString(e.GetListSourceFieldValue("FirstName")); string lastName = Convert.ToString(e.GetListSourceFieldValue("LastName")); string birthDate = Convert.ToString(e.GetListSourceFieldValue("BirthDate")); e.Value = firstName + "-" + lastName + "-" + birthDate; } }
protected void EmployeesGrid_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "Total") { if (e.IsGetData) { int visibleIndex = EmployeesGrid.FindVisibleIndexByKeyValue(e.GetListSourceFieldValue("FISNO")); e.Value = (visibleIndex != 0) ? Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "BORC")) + Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "ALACAK")) + Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex - 1, "Total")) : Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex, "BORC")) - Convert.ToDecimal(EmployeesGrid.GetRowValues(visibleIndex - 1, "Total")); } } }
protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e) { if (e.Column.FieldName == "LineChartValueUnbound") { Series seriesValue = (Series)e.GetListSourceFieldValue("LineChartValues"); WebChartControl1.Series.Clear(); WebChartControl1.Series.Add(seriesValue); using (MemoryStream s = new MemoryStream()) { WebChartControl1.ExportToImage(s, ImageFormat.Jpeg); Bitmap bitmap = (Bitmap)Image.FromStream(s); ImageConverter converter = new ImageConverter(); e.Value = (byte[])converter.ConvertTo(bitmap, typeof(byte[])); } } }