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
- Use the Grid Builder to create grid employees (based on the employees table
in the IntranetDB database).
- On Step 2 select the following fields from the 'Available Fields' list: emp_login, emp_name, title, email and phone_work.
- On Step 3 enable Create Search/Filter and select emp_name.
- On Step 4 check the box Add Panels to each column.
- 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).
- For each checkbox set the Data type property to Integer, the Checked
Value property to 1, and the Unchecked Value property to 0.
- Add Hidden control to the search form and name it
"is_set".
- Add the appropriate programming code to the Grid's Before Show and Before
Show Row events.
- 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.