Hi,
I have a grid then I am adding data using method : UltraGrid.Rows.Band.AddNew();Ultra Grid has been linked with DataSource. My problem is that sometime I have to allow user to add new rows but in other cases I need to reject some of them but other needs to commit. I have a question about how to cancel pending changes made to the DataSource. Right now I can manage Updates ( only ). Any suggestions or help would be helpful. Regards Piotrek
Use the BeforeRowInsert event and set e.Cancel = true to cancel the row insert.
Hi Amiram, Thank you for your answer. I think I don't precisely described my problem. I want actually row to appear on the grid (to enter data) but I do not want to create and entry in DataSource which will create and Insert to my database. On exit from my grid I want to decide which of those row I need to add and whichones I need reject without any information back to the user. I can't find any way to do this. My only idea is to create separate grid based on dummy table not linked to any DataSource and later on manually adding rows to my original DataSourse. Any idea how to solve it ? Regards Piotr
pjanet said: create and entry in DataSource which will create and Insert to my database.
create and entry in DataSource which will create and Insert to my database.
Does your data source save the data automatically? Why don't you let the grid insert the data and then decide whether to save it to the database?
Anyway, there is a property named UpdateMode which controls the data source update behavior. I don't know if it works for insert too, but try to set it to OnUpdate and each row you want to insert call its Update method.