This topic will show you how to update or delete row in WebGrid.
To update or delete a row on button click
- Drag WebGrid instance into the WebForm.
- Add a client side function on your code.
- You can update or delete grid's row by simply using:
-
JavaScript Copy Code function DeleteRow()
{
var grid = ISGetObject("WebGrid1");
var row = grid.RootTable.GetRowByKeyValue("VINET");
row.Delete(); // delete this row
alert("Customer 'VINET' has been deleted!");
}function UpdateRow()
{
var grid = ISGetObject("WebGrid1");
var row = grid.RootTable.GetRowByKeyValue("SPLIR");row.Update(); // perform Update
alert("ContactTitle of this row has been changed to 'Owner'");
}
Other Resources
Walkthrough Topics
How-to Topics