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?
음... I don't missing code ^^;
but my source code show you.
function SelectDeleteRow() { igtbl_getGridById("UltraWebGrid1").AllowDelete=1;
I could not get your code to work and not really sure how it helps my problem either. The original removeRow function I posted does remove the row from the grid but it does not fire my DeleteRow Event Handler in the code-behind as does a similar process with UpdateRow (processUpdateRow). I need to know what call to put in javascript that achieves the same goal. Right now the call does not happen until you click on another row which is not acceptible.
Basically I need to know the javascript equivalent for the DeleteRow call. This is what I do for the Edit function.
{
}
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.
Long time ago now, but did you ever find out how to trigger the DeleteRow event with javascript?
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);