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
765
WinGrid not updating/refreshing after edit made via RowEditTemplate
posted
I am using a RowEditTemplate that is associated with my Wingrid.  When the user clicks a row in the grid, the RowEditTemplate opens and the user can make their edits.   The problem is...when the user clicks the OK button (on the RowEditTemplate), the template closes, but the newly-made edits are not automatically reflected in the grid.  I am issuing these C# commands:

[TableAdapter].Update;  
[DataSet].[DataTable].AcceptChanges();
[Grid].Refresh();
[RowEditTemplate].Close(true);

Is there another set of ADO command(s) I need to issue that will close the RowEditTemplate and show these edits in the associated row?

Parents
  • 37774
    posted

    You shouldn't need to use any ADO commands, since these don't really have anything to do with the ties between the RowEditTemplate and the grid.  In fact, I don't think that you should call AcceptChanges and Refresh before closing the template, since at this point the cell values haven't been committed to the underlying row (depending on your RowUpdateMode), especially since the underlying IEditableObject (in this case a row in the DataTable) is still in the middle of an edit operation.  I think that calling AcceptChanges and then Refresh will cause any changes that you made in the template to be undone.  Try putting the call to Close before anything else.

    -Matt

Reply Children