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
250
is grid.Row.DataChanged still working ?
posted

Hello,

I have an datatable, bound to an UltraWingrid.

The idea is to allow the user to edit all cells he wants in the UltraWingrid.

Once he pressed an "update" button, the modifications will be written to the database.

I was hoping I could use following code (but it doesn't seem to work)

pseudocode ...

for each myrow in ugrid.rows

  select case myrow.datachanged

    case datachanged.added

      'add record to the database

    case datachanged.deleted

      'delete record from the database

   end select

next

I found this sample code at http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=8272, but it doesn't seem to work...

whatever "changes" the user makes, datachanged is always "false"

thanks in advance for your help

Grtz,

Johnny

 

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi Johnny,

    DataChanged doesn't really have any bearing on whether the changes are saved to the database. The grid only deals with the local data source - it has no connection to the back end.

    So DataChanged only tells you if a change in the grid has not yet been saved to the local DataSource. And even then the DotNet BindingManager will automatically update the data source any time the current position changes. So if you move to another row in the grid, any changes in the previous row are automatically committed to the data source and so DataChanged would be false.

    If you want to update your database in batches, then you need to use a DataSource that tracks the changes locally, like a DataTable or DataSet. This is between the data source and the database - the grid has no involvement in this process.

Reply Children