Greetings! I'm using the WebDataGrid for data entry, and I was wondering if the following was possible... I would like to have 1 button for saving all new entries as well as updating any that have changed. I would like to use the Add New row that's enabled in the Behaviors section, so effectively, if the user clicks this save button, it needs to update any data from the existing rows as well as check the Add New row for new data and add it if so. Also, I currently have AutoCRUD off as the RowAdding event is handled server-side. Thanks in advance!
Yup! Got it figured out... your recommendation is exactly what I needed to do. Thanks!
Hello kcrosson,
Were you able to handle this?
For any further questions do not hesitate to contact us.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
Hi kcrosson,
You can call _commitRow() off the row adding behavior.$find("WDG1").get_behaviors().get_editingCore().get_behaviors().get_rowAdding()._commitRow();This just goes through the add row cells and tries to add AND commit the new row (unless you have 11.2 and have on batch updating).
regards,
David Young
Hello Georg! I'm not sure this helps... the example you provided for updating is already how I'm handling the updating of data, but it doesn't address adding a row. I just need the Save button click to also consider the row used for adding data. Is that possible?
Thank you for posting in our community. Here is sample in our Samples browser that demonstrates this scenario.
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Editing-and-Selection/Editing-Rows-Server-Events/Default.aspx?cn=data-grid&sid=4a0988e8-db11-4279-96e3-af67946ddd54
Also note that in this sample it is used ObjectDataSource.
Some of the data sources can be updated automatically, follow this link for more details:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebDataGrid_Supported_Data_Sources.html
If you are using DataSource that is not automatically updated. You can Handle RowAdding and to add the new row you your data base or to the data source used and to handle RowUpdating for the rest of the changes done.
I hope this information helps.
For any further questions do not hesitate to contact me.