ASP.NET:在GridView的隐藏列ASP、NET、GridView

2023-09-04 10:48:55 作者:城市那么挤,人心那么空

有没有一种方法,我可以控制从code列。

Is there a way I can control columns from code.

我有一滴一滴框选择:日常和周末和周一,周二,周三,周四,周五,周六,周日在GridView列。 如果用户选择我每天想显示仅在周一列到周五。

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.

有可能从code来控制。哦,我用这griview在我的网页,并在完成编码使用C#。

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

帮助!

推荐答案

使用Columns属性:

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