Beispiel #1
0
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         decimal price1 = (decimal)e.GetListSourceFieldValue("KCF");
         decimal price2 = (decimal)e.GetListSourceFieldValue("ZCF");
         e.Value = price1 + price2;
     }
 }
 protected void grid_CustomUnboundColumnData(object sender,
                                             DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Total")
     {
         decimal price    = (decimal)e.GetListSourceFieldValue("UnitPrice");
         int     quantity = Convert.ToInt32(e.GetListSourceFieldValue("Quantity"));
         e.Value = price * quantity;
     }
 }
 protected void grid_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "Variance")
     {
         decimal unitPrice    = Convert.ToDecimal(e.GetListSourceFieldValue("UnitPrice"));
         decimal unitsInStock = Convert.ToDecimal(e.GetListSourceFieldValue("UnitsInStock"));
         if (unitPrice != 0)
         {
             e.Value = (unitPrice - unitsInStock) / unitPrice;
         }
         else
         {
             e.Value = 0;
         }
     }
 }
 // Fetch unbound data here
 protected void ASPxGridView1_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.IsGetData && e.Column.FieldName == "Comment")
     {
         object key = e.GetListSourceFieldValue(e.ListSourceRowIndex, ASPxGridView1.KeyFieldName);
         e.Value = MyComments.GetComment(key);
     }
 }
 protected void grid_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "percent")
     {
         if ((grid.GroupCount > 0))
         {
             string itemKeyValue = e.GetListSourceFieldValue("ProductID").ToString();
             object summaryValue = grid.GetGroupSummaryValue(GetGroupIndex(itemKeyValue), grid.GroupSummary[0]);
             if (summaryValue != null)
             {
                 e.Value = (decimal)e.GetListSourceFieldValue("UnitPrice") / (decimal)summaryValue;
             }
         }
         else
         {
             e.Value = (decimal)e.GetListSourceFieldValue("UnitPrice") / (decimal)grid.GetTotalSummaryValue(grid.TotalSummary[0]);
         }
     }
 }
Beispiel #6
0
 protected void grdInventoryCommand_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)
 {
     if (e.Column.FieldName == "PersonName")
     {
         InventoryAuditArtifact _inventoryAuditArtifact = session.GetObjectByKey <InventoryAuditArtifact>(e.GetListSourceFieldValue("InventoryCommandId"));
         if (_inventoryAuditArtifact != null)
         {
             foreach (InventoryCommandActor ica in _inventoryAuditArtifact.InventoryCommandActors)
             {
                 if (ica.InventoryCommandActorTypeId.Name == "CHIEFCHECKING")
                 {
                     if (ica.PersonId != null)
                     {
                         e.Value = ica.PersonId.Name;
                         break;
                     }
                 }
             }
         }
     }
 }