Hi Mohamad,
Your requirement to update the table summary value based on the checkbox being true can be achieved by using a custom aggregate. However, when updating the table summary value by changing the checkbox at runtime, you need to manually update the value inside the RecordPropertyChanged event. Please find the code snippet below.
Code snippet:
public class CustomAggregate : ISummaryAggregate { public CustomAggregate() { } public double StdDev { get; set; } Action<IEnumerable, string, PropertyDescriptor> ISummaryAggregate.CalculateAggregateFunc() { this.StdDev = 0; return (items, property, pd) => { var enumerableItems = items; if (pd.Name == "StdDev") { foreach(OrderInfo obj in enumerableItems) { if (obj.IsChecked) { this.StdDev += obj.Value2; } } } }; } } |
Your requirement to update the table summary value when adding a new row can be achieved by setting the LiveDataUpdateMode to AllowSummaryUpdate. Please find the code snippet below.
Code snippet:
sfDataGrid1.LiveDataUpdateMode = LiveDataUpdateMode.AllowSummaryUpdate; |
We have prepared a sample based on your requirements, along with a video reference. Please find it in the attachment.
Regards,
Sreemon Premkumar M.
Attachment:
SfDataGrid_TableSummary_82c68a1c.zip