Intersoft WebGrid Documentation
How-to: Get checked rows in client side
See Also Send comments on this topic.

Glossary Item Box

WebGrid provides a RowChecker feature which is very helpful to select multiple rows in WebGrid.

In this topic, you will learn the basic thing on how to get checked rows in client side.

To get checked rows in client side

  1. Add a HTML button in WebForm.
  2. Create test() function in client side like following:

    JavaScript Copy Code
    function test()
    {
      var grd = wgGetGridById("WebGrid1");
      var table = grd.GetRootTable();
      var checkedRows = table.GetCheckedRows();
      var tl = parseFloat(grd.TotalRows);
      for(var i=0; i<checkedRows.length; i++)
      {
        alert(checkedRows[i].cells[3].innerText);
      }
    }
    

  3. Add OnClick="test()" on your HTML button tag.
  4. Run the project.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.