Hi,
I am using UltraGrid with a BindingNavigator. When adding a new record with the BindingNavigator AddNewItem button I would like to supply default values to two cell in the new record. I have gotten this to work by using the AfterCellActivate event, it works but doesn't seem correct. I tried to initialize the default values with the grid but this didn't work.
After I edit the new row I want to validate the data when saving the changes with the BindingNavigator SaveItem button. I tried to run my code in the AfterRowInsert and AfterRowUpdate event, but they didn't fire. I can validate the data in the SaveItem code but unless I move the focus off the last cell in the new record to a different cell in the new record the code that tests the cell see that last value as DBNull.
Thanks for the Help
Adam
AfterRowInsert and AfterRowUpdate only fire when the user inserts or updates a row through the grid. If you are doing this through the BindingNavigator, then you would have to use some event of the BindingNavigator itself or perhaps the DataSource.
OK,
I have checked the values via the in the BindingNavigators SaveItem code, prior to EndEdit. But in this case I run into the problem that the last cell value added doesn't seem to be committed to the grid. When the grid loses focus I should be able to run a command to commit the last value so that my code doesn't see it as DBNull.
Thanks