Intersoft WebGrid Documentation
How-to: Get a column name of the selected cell
See Also Send comments on this topic.

Glossary Item Box

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

  1. Drag WebGrid instance into the WebForm.
  2. Add a client side function on your code.
  3. Select a row.
  4. You can get the grid's column name by simply using:

  5. JavaScript Copy Code
    function Button1_onclick() 
    {
    var grid = ISGetObject("WebGrid1");
    var rowElm = grid.GetSelectedObject().GetRowObject().GetElement();
    var columnName = wgGetColNameByCell(rowElm.cells[3]);
    alert(columnName);
    }

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.