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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridControl get row Changes back into Datatable

Thread ID:

Created:

Updated:

Platform:

Replies:

37434 Nov 22,2005 06:58 AM UTC Dec 21,2005 04:55 PM UTC WinForms 3
loading
Tags: GridControl
Brian Harrison
Asked On November 22, 2005 06:58 AM UTC

I am trying to save changes back to the original datatable that was used to populate the grid. I currently set the Grid(nRow,0).Tag value to indicate that the row has changes, But is there a simply way to iterate a row object or return a datarow/datatable object from the Grid rows that have been changed???

Administrator [Syncfusion]
Replied On November 22, 2005 09:20 AM UTC

Not if you are using a GridControl. If you have a DataTable and are using it by moving the data into a GridControl cell by cell, then the grid has no knowlegde of the datatable. One thing you could do is to handle the SaveCellInfo event. There, based on e.RowIndex and e.ColIndex, you could save e.Style.CellValue back to your DataTable at that point. Then the DataTable would be current at all times.

Brian Harrison
Replied On December 20, 2005 10:53 PM UTC

II tried using the SaveCellInfo Event and set the Row.Tag to true so I can find changed data later, however this ends in a endless loop and a stack overflow. Any Ideas. Basically anytime data changes I want to flag the raow much like a datatable sets the rowChanged flag, then iterate during a save and process the changes only back to the Database. ???? >Not if you are using a GridControl. If you have a DataTable and are using it by moving the data into a GridControl cell by cell, then the grid has no knowlegde of the datatable. One thing you could do is to handle the SaveCellInfo event. There, based on e.RowIndex and e.ColIndex, you could save e.Style.CellValue back to your DataTable at that point. Then the DataTable would be current at all times.

Administrator [Syncfusion]
Replied On December 21, 2005 04:55 PM UTC

Hi Brian, I don''t think there is an easy way since it is an unbound Grid with its own datastore. I think your approach should be good i.e., you can set the rowheader''s tag when the data changes for that particular row in SaveCellInfo. If you set the Tag''s value in the SaveCellInfo event handler, it will trigger the SaveCellInfo again leading to recursive loop. You can avoid this by making sure it doesn''t trigger for rowheader (0 th Column). Something like: private void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e) { if(e.ColIndex != 0) // Don''t trigger SaveCellInfo for rowheader.. this.gridControl1[e.RowIndex, 0].Tag = "true"; } Best regards, Jay

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;