开发者

asp.net: gridView rotate background color. setting a index column in a DataTable?

开发者 https://www.devze.com 2023-02-26 04:24 出处:网络
two questions about grindView and dataTable. how can i set a dataTable index which always counts one up?

two questions about grindView and dataTable.

  1. how can i set a dataTable index which always counts one up? e.g. i make a column: Columns.Add(new DataColumn("#")); and when i add a row, the # column is automatically increased?
  2. how can i rotate the background color in a g开发者_如何学运维ridView?


    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;
0

精彩评论

暂无评论...
验证码 换一张
取 消