Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
Grid is not recognizing DataChanged for Added Row
posted

Hi

 

I am building the editablegrid, which will have Updates, AddedNew and Delete basically CRUD operations

DataSource for the Grid is DataTable, so once all these CRUD happens, looping through and saving to DB

i am checking changed rows using like.....

if(row.DataChanged)

{

if(row.IsAddRow)

{

//Do Save

}

}

 

but, row.DataChanged is becoming true sometimes...almost the .DataChanged is false

what could be the issue? am i missing some thing?

and

Is there any good way of doing this task? any examples?

  • 469350
    Suggested Answer
    Offline posted

    What is "row" in the sample code you have here? Is this a grid row? Or a DataTable row?

    The WinGrid only deals with the local data source. The grid has no knowledge of the back end (the database). So if you are using a DataTable and you want to commit the changes from that DataTable back to the data base, you should be using the DataTable rows, not the WinGrid rows. In fact, the easiest way to do this is to use a DataAdapter. But the grid is not involved in the process at all.

    The DataChanged property on a grid row indicates if there is a change in the grid row as pertains to the grid's local data source. So that's not what you want here.