【问题标题】:asp.net: gridView rotate background color. setting a index column in a DataTable?asp.net:gridView 旋转背景颜色。在 DataTable 中设置索引列?
【发布时间】:2011-04-18 13:04:30
【问题描述】:

关于grindView和dataTable的两个问题。

  1. 如何设置一个总是向上计数的数据表索引? 例如我做一个专栏: Columns.Add(new DataColumn("#")); 当我添加一行时,#列会自动增加?
  2. 如何在 gridView 中旋转背景颜色?

【问题讨论】:

    标签: asp.net gridview datatable


    【解决方案1】:
        Set Rowstyle for gridview backcolour e.g.
    
        <asp:GridView id="gd" runat="Server">
    
              <RowStyle BackColor="Red" />
    
        </asp:GridView>
    
    If u want it from Code side then 
    
    For particular Column    
        gridview.Columns[0].ItemStyle.BackColor = System.Drawing.Color.Red;
    For grid
           gridview.BackColor = System.Drawing.Color.Red;
    

    【讨论】:

      猜你喜欢
      • 2015-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-25
      • 2012-10-16
      • 2015-12-26
      • 1970-01-01
      相关资源
      最近更新 更多