I have a WebDataGrid that is populated from a database. I also have a button and a dropdown on the page. The dropdown controls what data is displayed in the WebDataGrid. The RowUpdating gets called when I update a value and click on another row or click the button. However, if I click the dropdown or anywhere else on the page, RowUpdating does not get called. I need it to be called whenever the WebDataGrid loses focus and a row has been updated.
Jeff
Dear Jeff,
Thank you for contacting Infragistics!
We have received your support request concerning the RowUpdating not firing when the grid loses focus, and this case has been assigned to me. Infragistics is dedicated to helping you solve this issue. Our team and I have done an initial review of your case and I will create a sample to test this case. If you already have a sample that I can use as a starting point, that will help to resolve the case faster.
I am looking into why this may be occurring for you and will get back to you sometime Wednesday with more information or questions for you.
Looking forward to hearing from you.
Hi Jeff,
I found the following forum post that is similar to your question.
http://www.infragistics.com/community/forums/p/50225/264161.aspx#264161
Handling the CellEditing's ExitedEditMode event this way will cause the grid to update each time you stop editing a cell.
If you have any further questions or concerns with this please let me know and I'll be glad to help.
Michael,
That solution helps, but causes other issues. First, if a user Tabs to the next field, the OnRowUpdating event fires and after the update, focus returns to the field that was just edited. Also, if the user edits a field and then clicks on a drop-down that is not on the grid, the user would have to re-click to select from the drop-down. Is there a way to do this same sort of thing, but only when the user leaves the row, not a cell?
Thanks for the update. I'm going to need more a little more time to research this. I can have another update on my progress for you by Thursday.
If you have any questions or concerns with this please let me know and I'll be glad to help.
Thank you for your patience with this. You can use logic inside the ExitedEditMode event to check if the user was on the last cell in the row.
The following code snippet will perform this:
if (eventArgs.getCell().get_column().get_index() == eventArgs.getCell().get_row().get_cellCount() - 1) {
sender.get_behaviors().get_editingCore().commit();
}
Please let me know if you have any further questions or concerns with this and I'll be glad to help.
Hello Jeff,
Please let me know if you still need help with this issue.
Thanks, that does help. However, I would like it so that the record would be updated whenever the user leaves the row, not just when they where on the last cell. The user may only edit one column (not the last) and then click somewhere else on the page. I don't want the row to be updated every time the use exits edit mode, just when they leave the current row.
Thanks,
The grid's Selection behavior has a RowSelectionChanged client event that can be used to detect when the row changes. You can read more about the selection behavior in our documentation here:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataGrid_Selection.html
Calling the commit method in this event will send the info when the row changes.
Please let me know if you need further assistance with this and I'll be glad to help.
The RowSelectionChanged client event does not fire if the user clicks off of the grid completely. Also, if the user edits a cell and tabs to the next cell, the event fires. I would think it shouldn't fire in this case since the selected row did not change, only the selected cell. Is there an event that fires whenever the WebDataGrid loses focus where I could call the commit method from?