.net – ASP.NET : Hiding columns in gridview

asp.netgridviewnet

Is there a way I can control columns from code.

I had a drop drop box with select : Daily and weekend and the gridview column with Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,sunday.
If the user selects Daily i want to show columns only from Monday to Friday.

It is possible to control from the code. Oh i am using this griview in my webpage and coding in done using C#.

help!

Best Answer

Use Columns property:

GridView1.Columns[5].Visible = false
GridView1.Columns[6].Visible = false
Related Topic