Main page

Using the Panel to Hide/Show Grid Columns

Description

This example shows how to use the Panel to hide/show Grid Columns.

Steps to Recreate

  1. Use the Grid Builder to create grid employees (based on the employees table in the IntranetDB database).
  2. Add a new row to the search form. In the left cell enter 'Columns to show', then add the following checkboxes into the right cell: s_name, s_title, s_email, s_phone and the appropriate text nearby (Name, Title, Email and Phone).
  3. For each checkbox set the Data type property to Integer, the Checked Value property to 1, and the Unchecked Value property to 0.
  4. Add Hidden control to the search form and name it "is_set".
  5. Add the appropriate programming code to the Grid's Before Show and Before Show Row events.
  6. Make cosmetic changes as needed by modifying the text and captions within the HTML.

Database Tables Used

Database: IntranetDB

Tables: employees

Events Used

Grid's Before Show event is used to hide the Header cells.

Grid's Before Show Row event is used to hide the Data Columns.