Use wgGetColNameByCell function to get WebGrid column name of a selected cell in client side.
This topic will show you how to get WebGrid's column name.
To get WebGrid's column name by selecting a cell
- Drag WebGrid instance into the WebForm.
- Add a client side function on your code.
- Select a row.
- You can get the grid's column name by simply using:
-
JavaScript Copy Code function Button1_onclick()
{
var grid = ISGetObject("WebGrid1");
var rowElm = grid.GetSelectedObject().GetRowObject().GetElement();
var columnName = wgGetColNameByCell(rowElm.cells[3]);
alert(columnName);
}
Other Resources
Walkthrough Topics
How-to Topics