Tuesday, September 18, 2007 8:49 AM
So you have an Infragistics Ultra Web Grid on your web page, and you're utilizing the Row Edit Template for editing the row. What you may be experiencing is that you can add a row, but then need to double click the row to bring up the edit template. Wouldn't it be nice if you could just see the template when you add the row. Of COURSE it would be nice! Here's what you do:
function AddNewRow(gridId)
{
var grid=igtbl_getGridById(gridId);
igtbl_addNew(gridId,0);
grid.beginEditTemplate();
}
- Creates a variable to hold a reference to the grid.
- Adds a new row based on the gridId, and also sets it to active by default
- Finally, we use that grid variable to call the beginEditTemplate function which will display the row edit template.
Now in my case, I'm using a user control to dynamically output the javascript, so my gridId is coming from that...but if that's not your scenario, or if you have a simpler one (like one grid only in your app or something), there's obviously other ways to get the gridId in there.
D
So you have a button that you're going to use for adding a row. Set its client-side click event to this little function here. Here's what it does: