Home Forums WinForms controls Xceed Grid for WinForms SelectedRows and DataSet merge

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16447 |

    Hi

    We save each line of the grid to DB when you leave it or by hitting save button. I send those datarows down to the database and get dataset back wich contains changed  rows.  When I merge those two datasets (the original one and with fresh saved rows). I loose the selected rows from the grid. Can I merge dataset and still hold on to selected rows and current rows?

     

    best regards

    Einar 

    Imported from legacy forums. Posted by Goggi (had 538 views)

    User (Old forums)
    Member
    Post count: 23064

    This is not possible by just holding to the old DataRow instance since when the grid is reloaded with data, all DataRows instances are new ones.  So if you try to use the old instance to set the CurrentRow, the grid will raise an exception that the row does not belong to the grid, since it does not find the instance.

    What you could do is have a unique value from the old DataRow instance, and use this to make a search in the grid, and once you find the new DataRow instance, use it to set SelectedRows and CurrentRow.

     

    Imported from legacy forums. Posted by André (had 774 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.