I have an ultragrid, it is bound to a bindingsource, the bindingsource is created from a dataset.Let's say, I have 1 row in the dataset, so 1 row displayed in the ultragrid, then I inserted 2 new rows, then I delete one of them, now there are 2 rows in the ultragrid, but when I try to save the data into database, there are still 3 rows in the datatable of the dataset, and two of them are new created with the RowState=DataRowState.Added. So who can tell me how to synchronize the ultragird with the dataset behind it?
the ultragrid is bound to dataset in the following way!
BindingSource bindingSource= new BindingSource(DataSet, DataTableName);
Ultragrid.DataSource=bindingSource;
This really has nothing specifically to do with the grid. The DataSet tracks all changes to your data source, so if you add a row and then delete that row, it tracks both operations. The DataAdapter generally handles this when updating the back end, but the grid really has no involvement in that process.