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

Binding Datatable to Grouping Grid

I have attached a datatable to the grid grouping control.

grdcontrol.DataSource = m_datatable;

When the data on the grid changes, the datatable doesnt get updated. Which property should be set/called to updated the datatable when the grid changes?

Thanks


1 Reply

VK Vinoth Kumar K Syncfusion Team February 12, 2008 05:57 PM UTC

Hi Navaneeth,

Thanks for using Syncfusion Products.

By default, the grid datas should be updated to underlying datasource as you leave the row (not the cell). If you want the grid values updated as you leave the cell , you can add a CurrentRecordContextChange event handler, and call the Table.EndEdit method for the related table. This will update the underlying datasource if any changes is detected. Also you need to set the Table.TableDirty = true. This property indicates to the engine that it needs to re-categorize elements when the underlying datasource is updated. Below are the codes that shows this task.

private void grid1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if(e.Action == CurrentRecordAction.CurrentFieldChanged
|| e.Action == CurrentRecordAction.EndEditComplete )
{
this.grid.CurrencyManager.EndCurrentEdit();
e.Table.EndEdit();
e.Table.TableDirty = true;
}
}

Please try these code and let me know if this helps.

Best regards,
Vinoth



Loader.
Live Chat Icon For mobile
Up arrow icon