none
how to check for data change in a datagridview RRS feed

Answers

  • well firstly, if you bind a dataset to a datagridview then the dataset will be updated automatically. you can see if the dataset has changes (theDataSet.HasChanges()) or you can get changes:

    Dim theChanges as new DataSet() = theDataSet.GetChanges()

     

    this will return you the changes that the user has made in the first datatable I believe.

    does this help you?

    you could also implement a CellBeginEdit event for the datagridview. This will fire when the user starts to edit that cell but I don't think it will fire when the user actually starts to change the cell contents but will fire when it gains "input" status (ready to edit the content)

    you can use the CellValueChanged in the datagridview, the event, which will fire when the cell value has been changed.

    Tuesday, November 14, 2006 9:05 PM
    Moderator

All replies

  • well firstly, if you bind a dataset to a datagridview then the dataset will be updated automatically. you can see if the dataset has changes (theDataSet.HasChanges()) or you can get changes:

    Dim theChanges as new DataSet() = theDataSet.GetChanges()

     

    this will return you the changes that the user has made in the first datatable I believe.

    does this help you?

    you could also implement a CellBeginEdit event for the datagridview. This will fire when the user starts to edit that cell but I don't think it will fire when the user actually starts to change the cell contents but will fire when it gains "input" status (ready to edit the content)

    you can use the CellValueChanged in the datagridview, the event, which will fire when the cell value has been changed.

    Tuesday, November 14, 2006 9:05 PM
    Moderator
  • hi,

    what if i am working with LINQ, in LINQ we are not using any datasource, we just bind it with datagirdview.

    i my application i have to save all the changes to the database that user did like editing,deletion, new records

    Monday, October 19, 2009 11:45 AM