Use ActiveEditMode function to activate WebGrid edit mode in client side.
This topic will show you how to activate WebGrid's edit mode in a specific cell.
To activate or deactivate WebGrid edit mode in a specific cell
- Drag WebGrid instance into the WebForm.
- Add a client side function on your code.
- You can activate edit mode by simply using:
-
JavaScript Copy Code function SelectNewRow()
{
var grid = ISGetObject("WebGrid1");
var newRowElement = grid.RootTable.GetNewRow(); // return the html element of the newrow
var newRow = grid.RootTable.ToRowObject(newRowElement); // convert to WebGridRow object
newRow.Select(); // select new row
var cells = newRow.GetCells(); // populate cells
cells.GetNamedItem("City").ActivateEdit();
}
Other Resources
Walkthrough Topics
How-to Topics