Section headers in a Gridview?

Discussion in 'ASP .Net Building Controls' started by jonefer, May 14, 2008.

  1. jonefer

    jonefer Guest

    How can I add section headers in a Gridview... is this possible?

    Otherwise, I will have to put 3 gridviews in a table, and i'm not certain
    about how to control column width as if the grid was one piece:

    This is what I'm trying so far...
    'SecurityDisabled' is a class that just makes the element invisible - (so far)

    <table class="SecurityDisabled" style="width: 530px">
    <tr>
    <td align="left" style="font-weight: bold;
    font-size: x-small; width: 769px; color: black;
    font-family: 'Century Gothic'">
    Measure</td>
    <td align="center" style="font-weight: bold;
    font-size: x-small; width: 231px; color: black;
    font-family: 'Century Gothic'">
    Phys<br />
    Total</td>
    <td align="center" style="font-weight: bold;
    font-size: x-small; width: 231px; color: black;
    font-family: 'Century Gothic'">
    Phys<br />
    %</td>
    <td align="center" style="font-weight: bold;
    font-size: x-small; width: 231px; color: black;
    font-family: 'Century Gothic'">
    Spec<br />
    Avg</td>
    <td align="center" style="font-weight: bold;
    font-size: x-small; width: 231px; color: black;
    font-family: 'Century Gothic'">
    Target</td>
    </tr>
    <tr>
    <td colspan="5" style="font-weight: bold;
    font-size: x-small; color: black; font-family: Century Gothic">
    Coding Level Intensity</td>
    </tr>
    <tr>
    <td colspan="5" style="font-weight: bold;
    font-size: x-small; color: black; font-family: Century Gothic">
    Outpatient New</td>
    </tr>
    <tr>
    <td colspan="5" style="font-size: x-small;
    color: black; font-family: Century Gothic">
    <asp:GridView ID="gvResource_Detail_01"
    runat="server" AutoGenerateColumns="False" BorderStyle="Solid"
    GridLines="Horizontal" Style="font-size: x-small;
    color: black; font-family: 'Century Gothic'"
    Width="530px" OnRowDataBound="gvResource_Detail_RowDataBound">
    <Columns>
    <asp:BoundField
    DataField="Measure" HeaderText="Measure" SortExpression="Measure">
    <HeaderStyle
    HorizontalAlign="Left" />
    </asp:BoundField>
    <asp:BoundField
    DataField="Count" HeaderText="Count" SortExpression="Count">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="%" SortExpression="%">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox1" runat="server" Text='<%# Bind("[%]") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label1"
    runat="server" Text='<%# Bind("[%]") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    <asp:BoundField DataField="Spec
    Avg" HeaderText="Spec Avg" SortExpression="Spec Avg">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="Target" SortExpression="Target">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox2" runat="server" Text='<%# Bind("Target") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label2"
    runat="server" Text='<%# Bind("Target") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </td>
    </tr>
    <tr>
    <td colspan="5" style="font-weight: bold;
    font-size: x-small; color: black; font-family: Century Gothic">
    Outpatient Established</td>
    </tr>
    <tr>
    <td colspan="5" style="font-size: x-small;
    color: black; font-family: Century Gothic">
    <asp:GridView ID="gvResource_Detail_02"
    runat="server" AutoGenerateColumns="False" BorderStyle="Solid"
    GridLines="Horizontal" Style="font-size: x-small;
    color: black; font-family: 'Century Gothic'"
    Width="530px" OnRowDataBound="gvResource_Detail_RowDataBound">
    <Columns>
    <asp:BoundField
    DataField="Measure" HeaderText="Measure" SortExpression="Measure">
    <HeaderStyle
    HorizontalAlign="Left" />
    </asp:BoundField>
    <asp:BoundField
    DataField="Count" HeaderText="Count" SortExpression="Count">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="%" SortExpression="%">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox1" runat="server" Text='<%# Bind("[%]") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label1"
    runat="server" Text='<%# Bind("[%]") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    <asp:BoundField DataField="Spec
    Avg" HeaderText="Spec Avg" SortExpression="Spec Avg">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="Target" SortExpression="Target">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox2" runat="server" Text='<%# Bind("Target") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label2"
    runat="server" Text='<%# Bind("Target") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </td>
    </tr>
    <tr>
    <td colspan="5" style="font-weight: bold;
    font-size: x-small; color: black; font-family: Century Gothic">
    Specialty Referrals</td>
    </tr>
    <tr>
    <td colspan="5">
    <asp:GridView ID="gvResource_Detail_03"
    runat="server" AutoGenerateColumns="False" BorderStyle="Solid"
    GridLines="Horizontal" Style="font-size: x-small;
    color: black; font-family: 'Century Gothic'"
    Width="530px" OnRowDataBound="gvResource_Detail_RowDataBound">
    <Columns>
    <asp:BoundField
    DataField="Measure" HeaderText="Measure" SortExpression="Measure">
    <HeaderStyle
    HorizontalAlign="Left" />
    </asp:BoundField>
    <asp:BoundField
    DataField="Count" HeaderText="Count" SortExpression="Count">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="%" SortExpression="%">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox1" runat="server" Text='<%# Bind("[%]") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label1"
    runat="server" Text='<%# Bind("[%]") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    <asp:BoundField DataField="Spec
    Avg" HeaderText="Spec Avg" SortExpression="Spec Avg">
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField
    HeaderText="Target" SortExpression="Target">
    <EditItemTemplate>
    <asp:TextBox
    ID="TextBox2" runat="server" Text='<%# Bind("Target") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label2"
    runat="server" Text='<%# Bind("Target") %>'></asp:Label>
    </ItemTemplate>
    <HeaderStyle
    HorizontalAlign="Center" />
    <ItemStyle
    HorizontalAlign="Center" />
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </td>
    </tr>
    </table>
     
    jonefer, May 14, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hans Merkl
    Replies:
    4
    Views:
    10,750
    Steven Cheng[MSFT]
    Nov 15, 2005
  2. dont bother
    Replies:
    0
    Views:
    847
    dont bother
    Mar 3, 2004
  3. Phil
    Replies:
    4
    Views:
    716
    Gabriel Genellina
    Jan 17, 2010
  4. Ian
    Replies:
    2
    Views:
    2,073
  5. kampy
    Replies:
    9
    Views:
    360
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page