Intersoft WebGrid Documentation
Walkthrough: Using client side events
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to use the available client-side events to customize default client processing behavior.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Access to the Microsoft Access Northwind database.
  • Visual Studio 2005 Application.

 Step-By-Step Instructions

To create new web application and bind hierarchical WebGrid with DataSource

  1. Bind WebGrid to AccessDataSource.
  2. In LayoutSettings in IDE property window, expand ClientSideEvents.
  3. In OnRowSelect, open the dropdownlist and choose Add New Handler.
  4. Switch to HTML View and add the following function:

    JavaScript Copy ImageCopy Code
    function DoRowSelect(gridId, tblName, rowIndex) {
        alert("The row index of selected row is : " + rowIndex);
        return true;
    }
    

    The DoRowSelect function which is used to respond the RowSelect event has 3 parameters: gridId, tblName and rowIndex. You can do custom processing in the function and return true to process default behavior.

    WebGrid is built with complete client object model API that can be used to programmatically access or modify a behavior setting. You can get the instance of the WebGrid object in client by using: var gridObject = ISGetObject(gridName);

    The gridObject is the top most level object in the WebGrid client object model API. The gridObject contains Tables collection which contains Table object that defined in server side. Complete client side API documentation will be available in Intersoft's Developer Network.

  5. Compile and run the WebForm.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.