We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

updating summary

I have a gridgroupingcontrol. I use the following snippet to create a new row.
DataTable dt = grid.DataSource;
DataRow dr = dt.NewRow();
...
dt.Rows.Add(dr);

And when I edit the new row, the summary does not get updated when I leave the cell (still in the same row). I tried http://www.syncfusion.co.in/support/kb/685/In-a-GridGroupingControl,-how-can-I-get-the-summaries-to-update-immediately-upon-changing-a-field,-and-not-have-to-wait-until-I-leave-the-row
but it does not work for me. I need to explicitly touch(set) any other field in that row and call grid.Refresh() before invalidate the summary. And even that, it works only for 'SUM', but not for 'COUNT' on string field.
Does anyone know about that?
Thanks

1 Reply

CI Christopher Issac Sunder K Syncfusion Team August 16, 2010 10:16 AM UTC

Hi Yuazhe,

Thank you for your interest in Syncfusion products.

To achieve the desired behavior, you can place the Refresh() method after invalidate the summary within the “CurrentRecordContextChange” event.


this.gridGroupingControl1.CurrentRecordContextChange += new CurrentRecordContextChangeEventHandler(gridGroupingControl1_CurrentRecordContextChange);

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if(e.Action == CurrentRecordAction.EndEditComplete)
{
this.gridGroupingControl1.CurrencyManager.EndCurrentEdit();
this.gridGroupingControl1.Table.InvalidateSummary();
this.gridGroupingControl1.Refresh();//refresh after invalidate the summary.
}
}


Please refer the following sample which illustrates the above.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=SummaryUpdate400016194.zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample.

Regards,
Christo.

Loader.
Live Chat Icon For mobile
Up arrow icon