I have a GridDataBoundGrid on a form, and I set the EnableAddNew = false and I use a button to add rows with the following code:
this.grid.Binder.EnableAddNew = true; this.grid.Binder.AddNew();
this.grid.Binder.EnableAddNew = false;
But I have a problem:
I add a row and I make some changes in this row. If I add a new row with the same mechanism the changes in the anterior row are lost and the row is initialized with the default values.
I want all changes I make to remain when I add a row.Thank you
ADAdministrator Syncfusion Team March 29, 2004 02:30 AM
Before doing the code to add the new row, call this.grid.Binder.EndEdit() to tell the grid to save any open changes. You also may want to first call this.grid.CurrentCell.EndEdit() if you are alolowing teh user to type into the grid to add the new values.
Or, you can just add the row directly to the DataSource and not use the grid at all.