Intersoft WebGrid Documentation
Walkthrough: Hiding certain columns programmatically
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to hide certain column programmatically in server side.

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 2003 Application.

 Step-By-Step Instructions

  1. Binding WebGrid to AccessDataSource.
  2. Add the following codes in InitializeRow server side event:

    C# Copy Code
    protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)    
    {        
       WebGrid1.RootTable.Columns.GetNamedItem("Address").Visible = false;        
       WebGrid1.RootTable.Columns.GetNamedItem("CompanyName").Visible = false;    
    }
    

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.