Use client side function to get value from hidden column on WebGrid.
This topic will show you how to get the value.
To get value from hidden column using HiddenDataMember
- Drag WebGrid instance into the WebForm.
- Set HiddenDataMember property to one of column you want to hide, for example : City.
- Add a client side function on your code.
- Select a row.
- You can get grid's value by simply using:
-
JavaScript Copy Code function getdata()
{
var grid = ISGetObject("WebGrid1");
var rowObj = grid.GetSelectedObject().GetRowObject();
var cells = rowObj.GetCells();
var customer = cells.GetNamedItem("CustomerID");
var city = customer.GetElement().attributes["City"].value;
alert(city);
}
Other Resources
Walkthrough Topics
How-to Topics