I figured out how to do the auto postback doing an edit but I cannot get the DeleteRow process to work without requiring another rowselection. I have added the code from the Samples:
function removeRow() {var activeRow = igtbl_getGridById(_clientGridID).getActiveRow();if (activeRow != null) {activeRow.deleteRow();activeRow.endEditRow();}}
And then added the necessary items to my code-behind. I initialize my UpdateRow event and then add the necessary code to update the database. The problem is the event does not get fired until I select another row. With the update all I had to do was call the activeRow.processUpdateRow() from javascript and it would fire immediately. I read othe posts about this and the person talks about just using the UpdateRow process. That means I will have to have a Delete mechanism in my RowEditTemplate which I don't want. Either that or I am missing the one piece that will have that statement make sense.
What am I missing?
You can delete a row Client Side with
var grid = igtbl_getGridById(gridName);
grid.Rows.remove(index);
and Server Side with
UltraWebGrid1.Rows.RemoveAt(index); or the other overriden method which takes the UltraGridRow to be removed.
In fact, I would just like to know how you trigger the DeleteRow event (preferably with javascript). The documentation I found says: "DeleteRow event: Occurs when a row is about to be deleted." But how do I start to delete it?
Not sure what's the problem, but if you want to postback after deleting a row you could use the AfterRowDeletedHandler (javascript) and force the postback with this code within the function:
__doPostBack(igtbl_getGridById('<%=yourGrid.ClientID%>'));
or
__doPostBack(null);
Long time ago now, but did you ever find out how to trigger the DeleteRow event with javascript?
Does anyone have any ideas on how to help with this? It seems like it would be a common task to want to delete items from the UltraWebGrid using the code-behind instead of a Data Set.