How to hide a column in Gridview by request of button click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coreyk
    New Member
    • Sep 2010
    • 1

    How to hide a column in Gridview by request of button click

    I have been trying for ever to hide a column in gridview using the following code,

    GridView1.Colum ns[6].Visible = false;

    but the debugger says that index is out of range, the number columns when runnung Columns.Count is zero

    even though I have a table with data it says that there are no columns
  • veenna
    New Member
    • Dec 2007
    • 65

    #2
    You should bind the grid view first, before making the column invisible.

    regards,
    veena

    Comment

    Working...