I want to show the Row Template for my WebGrid when the AddNewBox is clicked (not when a row is clicked, as it does by default). But, I can't find the JavaScript call to do this. Has anyone done this before?
Hi,
To open the RowEditTemplate for WebGrid when the AddNewBox Button is clicked, the client side event "AfterRowInsert" needs to be handled. To include this event handler, open the Properties window and locate the DisplayLayout section and then expand the ClientSideEvents section and navigate to AfterRowInsert event and then add a new handler. This creates JavaSript method signature in the HTML source code. The method should look like as follows:
function
UltraWebGrid1_AfterRowInsertHandler(gridName, rowId, index)
{
var
row = igtbl_getRowById(rowId);
row.editRow(
true); //opens the RowEditTemplate
}
Here the new row is accessed and sent to edit mode and this opens up the RowEditTemplate.
Hope this helps.
Thanks