I am fairly new to asp.net webforms and I have the following code to generate a grid with two columns,
I separated the columns using colours which I am able to do using e.Row.Cells[0].BackColor = Color.FromArgb(152, 251, 152);
and for the second column e.Row.Cells[1].BackColor = Color.FromArgb(60, 179, 113)
at the back end
what i am trying to achieve now is to colour the part of the GridView Header that is over the FirstColumn to the same colour as the first column and the second portion of the GridView Header that is over SecondCoumn to the same colour as the second column
Below is m y code
<asp:GridView ID="GridData" CssClass="Gridview" runat="server"
Width="100%" AutoGenerateColumns="False" OnRowDataBound="GridData_RowDataBound" ShowFooter="True">
<Columns>
<asp:TemplateField ItemStyle-Width="120px" HeaderText="ColumnFirst" >
<ItemTemplate>
<asp:Label ID="lblLoanGiven" runat="server"></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalLoanGiven" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="120px" HeaderText="ColumnSecond">
<ItemTemplate>
<asp:Label ID="lblLoanGivenBalance" runat="server"></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotalLoanGivenBalance" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<PagerStyle BackColor="#3C8DBC" ForeColor="White" />
<HeaderStyle BackColor="#3C8DBC" ForeColor="White" />
<FooterStyle BackColor="#007C98" ForeColor="White" CssClass="footer-design" />
</asp:GridView>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…