In a UltraGrid (Infragistics.Win.UltraWinGrid.UltraGrid), how can I know if the selected row has been updated in the DataSource associated of the grid?I try to insert a row but when you update the DataSet associated with the grid (pAdapterArt.Update (pDataSet, table)) generate error for example by primary key duplicate, so the record is not inserted.Later, How can I identify that the row selected has been updated in a DataSet of the grid or not?Thank you
Hi,
I'm not exactly sure what you are asking.
There are two layers of updating that take place when you use a grid or other bound control. The first layer is between the grid and it's DataSource. Changes made in the grid are written to the DataSource depending on the UpdateMode property. By default, it happens whenever the grid loses focus or the focus leaves a grid cell.
The second layer is between the grid's DataSource and the back end. The grid has no role in this process. If you are using a DataSet, then the DataSet itself tracks all changes that are made to it, and the DataAdapter class is intended to help you to write those changes back to the database.
It sounds like the problem here is between the DataSet, DataAdapter, and the back end. So your best bet for assistance with something like that is Microsoft's documentation, since as I said, he grid plays no role in that part of things.
You probably have to use some kind of fake primary key in your DataSet/DataTable and then correct the key when you get a real key from the DataBase.
I will try to re-explain my problem.I have an editable grid, whose DataSource is associated with a DataSet.In the grid I add a row forcing an error, so can not be updated in the DataSource as the update generates an exception. Until this point all is correct.
But when I navigate through the rows, how can I identify that it's a new row that has not been updated in the DataSource? Why Row.IsAddNew is false?? In the process implemented to eliminate rows, if you have not been updated in the database (DataSource), only I have to clean the grid, do not access the database, and I don't know how to identify it ...