Does the wingrid have a property that can be viewed to see if a row has been modified, added, or deleted.
Thanks
Sal
If you are bound to a DataTable, and the UltraGridRows represent DataRowView objects, you can get a reference to the underlying DataRowView via the UltraGridRow's ListObject property (upcast it to typeof(DataRowView)). Once you have that, you can get a reference to the underlying DataRow via that DataRowView's Row property. DataRow exposes a RowState property, which contains information like whether the row was added, deleted, or modified.
Note that UltraGridRow also exposes a DataChanged property, which tells you if the data in any cells have been modified.
Brian Fallon"]Note that UltraGridRow also exposes a DataChanged property, which tells you if the data in any cells have been modified.
True, and i thought that would help me, but i'm using a UltraGridRowEditTemplate and when i add a new row, the property is marked false. Thus the question i have posted.
My guess is that the property in the grid will only return true if you edit the data in the grid. If you edit the data through the RowEditTemplate, or though some other bound control, then the grid will not know about it.
You should probably rely on the state information provided by the DataSet/DataTable.
It probably doesn't update the value until you leave the cell. You can call Update on the row to force it to commit the changes to the underlying data row and then check the RowState afterward.
Seem it doesn't work for the columns of which the "ValueList" property is set to a UltraDropDown.
When I change the cell value by choose a item in the UltraDropDown, the row state is still "DataRowState.Unchanged", not the exprected "DataRowState.Modified'. When I change the cell value that has default setting, I could get the expected results.
Thank you Brian, your suggestion worked.
Here is the sample code is used:
foreach (UltraGridRow row in UltraGrid1.Rows) { DataRowView drv = (DataRowView) row.ListObject; MessageBox.Show("Row State: " + drv.Row.RowState); }
Thanks for the input, I will try the suggestion. I will let you know what happens.