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

Get values of only those rows which user has modified

Hi,
I have databound Grid Grouping Control with one column as GroupId and other as checkbox columns.I want to get values of only those rows which user has modified and save that to database.Also i have one simple parent-child relationships in it--that is it is heirchical grid grouping control.I want only values of rows which user has changed in child table of hierchical grid grouping control.Any help/insights would be highly appreciated.

with warm regards,
Manish Bafna.

5 Replies

AD Administrator Syncfusion Team March 5, 2007 10:03 PM UTC

Hi Manish,

You can set the DataView.RowStateFilter to RowViewStateFilter.ModifiedOriginal to get the modified rows in a underlying datasource of the grid. Here is a minimal sample that shows you "How to access the modified rows in a grid?".

For more details, see the below link.
http://websamples.syncfusion.com/samples/Grid.Windows/F57454/main.htm

Best regards,
Haneef


MB Manish Bafna March 6, 2007 07:59 AM UTC

Hi,
I have tried the code in sample but it is not working.After modifying data in GGC when i check dt.DefaultView.Count,it is always zero
I have one simple parent-child relationship in databound Grid Grouping Control.Now there is databound checkbox column in child table of this hierchical GGC(which is editable).When the user click save button i need to save these changed value in the database.GGC is binded to parent table of dataset.So how will i get reference to child table when i write datatable dt = ggc.Datasource.Afterwards i am going to write dt.defaultview.rowstatefilter = RowStateFilter.ModifiedOriginal.

>Hi Manish,

You can set the DataView.RowStateFilter to RowViewStateFilter.ModifiedOriginal to get the modified rows in a underlying datasource of the grid. Here is a minimal sample that shows you "How to access the modified rows in a grid?".

For more details, see the below link.
http://websamples.syncfusion.com/samples/Grid.Windows/F57454/main.htm

Best regards,
Haneef


MB Manish Bafna March 6, 2007 02:03 PM UTC

Hi,
I have followed the sample given by you.
But when i write ds.Tables["ChildTableName"].GetChanges() it is returning all the rows instead of returning just changed rows.When we debug and see the value of changed row it is showing changed value but rowstate of all the rows is "Added".
because of this when i write dt.DefaultView.RowStateFilter = DataViewRowState.ModifiedOriginal and if check dt.DefaultView.Count then we find that it is returning zero.
I am working on it for last five hours but not able to figure out what the probelm is
It is really urgent for me.Any insights would be highly appreciated.

with warm regards,
Manish Bafna.

>Hi,
I have tried the code in sample but it is not working.After modifying data in GGC when i check dt.DefaultView.Count,it is always zero
I have one simple parent-child relationship in databound Grid Grouping Control.Now there is databound checkbox column in child table of this hierchical GGC(which is editable).When the user click save button i need to save these changed value in the database.GGC is binded to parent table of dataset.So how will i get reference to child table when i write datatable dt = ggc.Datasource.Afterwards i am going to write dt.defaultview.rowstatefilter = RowStateFilter.ModifiedOriginal.

>Hi Manish,

You can set the DataView.RowStateFilter to RowViewStateFilter.ModifiedOriginal to get the modified rows in a underlying datasource of the grid. Here is a minimal sample that shows you "How to access the modified rows in a grid?".

For more details, see the below link.
http://websamples.syncfusion.com/samples/Grid.Windows/F57454/main.htm

Best regards,
Haneef


AD Administrator Syncfusion Team March 6, 2007 08:48 PM UTC

Hi Manish,

Before assigning the underlying datasource of the Grid, you need to call the AcceptChanges method of the DataTable. Andalso call the DataSet.AcceptChanges method to commit the datasource. Please let me know if this helps.

Best regards,
Haneef


MB Manish Bafna March 7, 2007 10:13 AM UTC


Thanks a lot.It is working.

With Warm Regards,
Manish Bafna.

>Hi Manish,

Before assigning the underlying datasource of the Grid, you need to call the AcceptChanges method of the DataTable. Andalso call the DataSet.AcceptChanges method to commit the datasource. Please let me know if this helps.

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon