Intersoft WebGrid Documentation
How-to: Prevent grouping on specific columns using OnColumnGroup
See Also Send comments on this topic.

Glossary Item Box

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

In this topic, you will learn the basic thing on how to prevent grouping on specific column using OnColumnGroup.

To prevent grouping on spesific column using OnColumnGroup

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

    JavaScript Copy ImageCopy Code
    function WebGrid1_OnColumnGroup(controlId, columnObject)
    {
      var WebGrid1 = ISGetObject(controlId);
      var colName = columnObject.Name;
      if(colName == "CustomerID")
      {
        return false;
      }
      return true;
    }
    

  4. Run the project.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.