locked
Row Headers in DGV RRS feed

  • Question

  • User1372787940 posted

    Right now I have all my columns bounded..however, I want to add row headers, from Jan-Dec in my dgv how would I go about doing that?

    <asp:GridView ID="GridViewChart" runat="server" Width="876px" 
            AutoGenerateEditButton="True"  DataSourceID="SqlChart"  BackColor="blue" 
                          BorderColor="Blue" BorderWidth="5px" 
                          CellPadding="3" ForeColor="Black" 
                          GridLines="None" BorderStyle="None" CellSpacing="2" 
                          AutoGenerateColumns="False" OnRowCreated="GridViewChart_RowCreated">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="vacAccrued" 
                                    HeaderText="Accrued" 
                                    SortExpression="vacAccrued" />
                    <asp:BoundField DataField="vacUsed" 
                                    HeaderText="vacUsed" 
                                    SortExpression="perUsed" />
                    <asp:BoundField DataField="vacBalance" 
                                    HeaderText="Balance" 
                                    SortExpression="vacBalance" />
                    <asp:BoundField DataField="perAccrued" 
                                    HeaderText="Accrued" 
                                    SortExpression="perAccrued" />
                     <asp:BoundField DataField="perUsed" 
                                    HeaderText="Used" 
                                    SortExpression="perUsed" />
                     <asp:BoundField DataField="perBalance" 
                                    HeaderText="Balance" 
                                    SortExpression="perBalance" />
                     <asp:BoundField DataField="totalBalance" 
                                    HeaderText="Total Balance" 
                                    SortExpression="totalBalance" />
                     <asp:BoundField DataField="Sick" 
                                    HeaderText="Sick" 
                                    SortExpression="Sick" />
                     <asp:BoundField DataField="other" 
                                    HeaderText="Other" 
                                    SortExpression="other" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>

    Friday, January 31, 2014 2:09 PM

Answers