使用asp.net c#动态更改网格视图的网格线

时间:2016-10-07 12:09:16

标签: asp.net c#-4.0

这里我是添加动态网格视图,这里是如何使用Asp.Net C#动态更改网格视图的GridLines。 感谢...

myGrid.DataSource = dt;
myGrid.DataBind();
 myGrid.GridLines = "Vertical";   // Here Not Working
 myGrid.Width = 1000;

输出:

__________________________________________________________________
Location                 Category                   Total
_________________________________________________________________
   a                     Cat1                          2
_________________________________________________________________
   b                      Cat2                         4
_________________________________________________________________
   c                     Cat3                          3
_________________________________________________________________

1 个答案:

答案 0 :(得分:0)

您必须在GridView中指定CssClass并基于它将被应用。

See Example