Intersoft WebGrid Documentation
How-to: Display the selected cell's text using OnCellSelect
See Also Send comments on this topic.

Glossary Item Box

This walkthrough will show you how to use OnCellSelect client side event.

In this topic, you will learn the basic thing on how to display the selected cell's text using OnCellSelect.

To display the selected cell's text in WebGrid

  1. Select WebGrid's instance and press F4.
  2. In Layout Settings, select ClientSideEvents, then set OnCellSelect to WebGrid1_OnCellSelect.
  3. Write the following function in OnCellSelect client side event:

    JavaScript Copy ImageCopy Code
    function WebGrid1_OnCellSelect(controlId, tblName, rowIndex, cellIndex)
    {
       var WebGrid1 = ISGetObject(controlId);
       var selObj = WebGrid1.GetSelectedObject().GetRowElement();
       var cell = selObj.cells[cellIndex+1].innerText;
       alert(cell);
       return true;
    }
    

  4. Run the project.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.