Headers in Datagrid spanning multiple columns.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Billy Jacobs

    #1

    Headers in Datagrid spanning multiple columns.

    I am using a datagrid to display some data. I need to
    create 2 header rows for this grid with columns of
    varying spans. In html it would be the following.

    <Table>
    <tr>
    <td colspan=8>Offic ial Impact Summary</td>
    </tr>
    <tr>
    <td colspan=2></td>
    <td colspan=3>Progr am Totals</td>
    <td colspan=3>Offic ial Totals</td>
    </tr>
    <tr><td></td>...

    Is this kind of thing possible with a datagrid and if so
    how do I do it.

    Thanks,

    Billy Jacobs
  • Jeffrey Tan[MSFT]

    #2
    RE: Headers in Datagrid spanning multiple columns.


    Hi Billy,

    If you want to add one head row to the datagrid, you can use the
    HeaderStyle.
    If you want to add more rows, you can simply create a parent table which
    contains
    your 2 tablerows, then place the datagrid control into the bottom table
    item.

    Hope this helps.

    Best regards,
    Jeffrey Tan
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    --------------------
    | Content-Class: urn:content-classes:message
    | From: "Billy Jacobs" <billnospam@csa .com>
    | Sender: "Billy Jacobs" <billnospam@csa .com>
    | Subject: Headers in Datagrid spanning multiple columns.
    | Date: Sun, 14 Sep 2003 00:28:13 -0700
    | Lines: 21
    | Message-ID: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="iso-8859-1"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    | Thread-Index: AcN6kcGQTlsc6vV 6SDiL96c0/deuoQ==
    | Newsgroups: microsoft.publi c.dotnet.genera l
    | Path: cpmsftngxa06.ph x.gbl
    | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:108413
    | NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
    | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
    |
    | I am using a datagrid to display some data. I need to
    | create 2 header rows for this grid with columns of
    | varying spans. In html it would be the following.
    |
    | <Table>
    | <tr>
    | <td colspan=8>Offic ial Impact Summary</td>
    | </tr>
    | <tr>
    | <td colspan=2></td>
    | <td colspan=3>Progr am Totals</td>
    | <td colspan=3>Offic ial Totals</td>
    | </tr>
    | <tr><td></td>...
    |
    | Is this kind of thing possible with a datagrid and if so
    | how do I do it.
    |
    | Thanks,
    |
    | Billy Jacobs
    |

    Comment

    • Billy Jacobs

      #3
      RE: Headers in Datagrid spanning multiple columns.

      Yes but I need the header rows in the parent table to
      exactly span a certain number of rows in the child table.

      Is this possible and if so could you send me a small
      example?

      Thanks,

      Billy Jacobs[color=blue]
      >-----Original Message-----
      >
      >Hi Billy,
      >
      >If you want to add one head row to the datagrid, you can[/color]
      use the[color=blue]
      >HeaderStyle.
      >If you want to add more rows, you can simply create a[/color]
      parent table which[color=blue]
      >contains
      >your 2 tablerows, then place the datagrid control into[/color]
      the bottom table[color=blue]
      >item.
      >
      >Hope this helps.
      >
      >Best regards,
      >Jeffrey Tan
      >Microsoft Online Partner Support
      >Get Secure! - www.microsoft.com/security
      >This posting is provided "as is" with no warranties and[/color]
      confers no rights.[color=blue]
      >
      >--------------------
      >| Content-Class: urn:content-classes:message
      >| From: "Billy Jacobs" <billnospam@csa .com>
      >| Sender: "Billy Jacobs" <billnospam@csa .com>
      >| Subject: Headers in Datagrid spanning multiple columns.
      >| Date: Sun, 14 Sep 2003 00:28:13 -0700
      >| Lines: 21
      >| Message-ID: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
      >| MIME-Version: 1.0
      >| Content-Type: text/plain;
      >| charset="iso-8859-1"
      >| Content-Transfer-Encoding: 7bit
      >| X-Newsreader: Microsoft CDO for Windows 2000
      >| X-MimeOLE: Produced By Microsoft MimeOLE[/color]
      V5.50.4910.0300[color=blue]
      >| Thread-Index: AcN6kcGQTlsc6vV 6SDiL96c0/deuoQ==
      >| Newsgroups: microsoft.publi c.dotnet.genera l
      >| Path: cpmsftngxa06.ph x.gbl
      >| Xref: cpmsftngxa06.ph x.gbl[/color]
      microsoft.publi c.dotnet.genera l:108413[color=blue]
      >| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
      >| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
      >|
      >| I am using a datagrid to display some data. I need to
      >| create 2 header rows for this grid with columns of
      >| varying spans. In html it would be the following.
      >|
      >| <Table>
      >| <tr>
      >| <td colspan=8>Offic ial Impact Summary</td>
      >| </tr>
      >| <tr>
      >| <td colspan=2></td>
      >| <td colspan=3>Progr am Totals</td>
      >| <td colspan=3>Offic ial Totals</td>
      >| </tr>
      >| <tr><td></td>...
      >|
      >| Is this kind of thing possible with a datagrid and if[/color]
      so[color=blue]
      >| how do I do it.
      >|
      >| Thanks,
      >|
      >| Billy Jacobs
      >|
      >
      >.
      >[/color]

      Comment

      • Jeffrey Tan[MSFT]

        #4
        RE: Headers in Datagrid spanning multiple columns.


        Hi Billy,

        I think I do not quite understand your meanning.
        What do you mean that "span a certain number of rows in the child table"?
        I can not form an image of what you want in my mind.

        Best regards,
        Jeffrey Tan
        Microsoft Online Partner Support
        Get Secure! - www.microsoft.com/security
        This posting is provided "as is" with no warranties and confers no rights.

        --------------------
        | Content-Class: urn:content-classes:message
        | From: "Billy Jacobs" <billnospam@csa .com>
        | Sender: "Billy Jacobs" <billnospam@csa .com>
        | References: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
        <x$Iw1PDfDHA.33 20@cpmsftngxa07 .phx.gbl>
        | Subject: RE: Headers in Datagrid spanning multiple columns.
        | Date: Thu, 18 Sep 2003 20:13:32 -0700
        | Lines: 81
        | Message-ID: <0b5401c37e5c$0 16cbba0$a101280 a@phx.gbl>
        | MIME-Version: 1.0
        | Content-Type: text/plain;
        | charset="iso-8859-1"
        | Content-Transfer-Encoding: 7bit
        | X-Newsreader: Microsoft CDO for Windows 2000
        | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
        | Thread-Index: AcN+XAFsRhWAifr PTYmLs5IHxzy8SA ==
        | Newsgroups: microsoft.publi c.dotnet.genera l
        | Path: cpmsftngxa06.ph x.gbl
        | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109133
        | NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
        | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
        |
        | Yes but I need the header rows in the parent table to
        | exactly span a certain number of rows in the child table.
        |
        | Is this possible and if so could you send me a small
        | example?
        |
        | Thanks,
        |
        | Billy Jacobs
        | >-----Original Message-----
        | >
        | >Hi Billy,
        | >
        | >If you want to add one head row to the datagrid, you can
        | use the
        | >HeaderStyle.
        | >If you want to add more rows, you can simply create a
        | parent table which
        | >contains
        | >your 2 tablerows, then place the datagrid control into
        | the bottom table
        | >item.
        | >
        | >Hope this helps.
        | >
        | >Best regards,
        | >Jeffrey Tan
        | >Microsoft Online Partner Support
        | >Get Secure! - www.microsoft.com/security
        | >This posting is provided "as is" with no warranties and
        | confers no rights.
        | >
        | >--------------------
        | >| Content-Class: urn:content-classes:message
        | >| From: "Billy Jacobs" <billnospam@csa .com>
        | >| Sender: "Billy Jacobs" <billnospam@csa .com>
        | >| Subject: Headers in Datagrid spanning multiple columns.
        | >| Date: Sun, 14 Sep 2003 00:28:13 -0700
        | >| Lines: 21
        | >| Message-ID: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
        | >| MIME-Version: 1.0
        | >| Content-Type: text/plain;
        | >| charset="iso-8859-1"
        | >| Content-Transfer-Encoding: 7bit
        | >| X-Newsreader: Microsoft CDO for Windows 2000
        | >| X-MimeOLE: Produced By Microsoft MimeOLE
        | V5.50.4910.0300
        | >| Thread-Index: AcN6kcGQTlsc6vV 6SDiL96c0/deuoQ==
        | >| Newsgroups: microsoft.publi c.dotnet.genera l
        | >| Path: cpmsftngxa06.ph x.gbl
        | >| Xref: cpmsftngxa06.ph x.gbl
        | microsoft.publi c.dotnet.genera l:108413
        | >| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
        | >| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
        | >|
        | >| I am using a datagrid to display some data. I need to
        | >| create 2 header rows for this grid with columns of
        | >| varying spans. In html it would be the following.
        | >|
        | >| <Table>
        | >| <tr>
        | >| <td colspan=8>Offic ial Impact Summary</td>
        | >| </tr>
        | >| <tr>
        | >| <td colspan=2></td>
        | >| <td colspan=3>Progr am Totals</td>
        | >| <td colspan=3>Offic ial Totals</td>
        | >| </tr>
        | >| <tr><td></td>...
        | >|
        | >| Is this kind of thing possible with a datagrid and if
        | so
        | >| how do I do it.
        | >|
        | >| Thanks,
        | >|
        | >| Billy Jacobs
        | >|
        | >
        | >.
        | >
        |

        Comment

        • Billy Jacobs

          #5
          RE: Headers in Datagrid spanning multiple columns.

          Sorry I meant that I need the headers to span a certain
          number of columns as described here.

          I want to accomplish the following except with a datagrid.

          <Table>
          <tr>
          <td colspan=8>Offic ial Impact Summary</td>
          </tr>
          <tr>
          <td colspan=2></td>
          <td colspan=3>Progr am Totals</td>
          <td colspan=3>Offic ial Totals</td>
          </tr>
          <tr> 'Here would be my bound rows.
          <td>Col1Info</td><td>Col2Info </td><td>Col3Info </td>
          <td>Col4Info</td><td>Col5Info </td><td>Col6Info </td>
          <td>Col7Info</td><td>Col8Info </td>
          </tr>
          <tr>...</table>


          Thanks,

          Billy Jacobs

          Comment

          • Jeffrey Tan[MSFT]

            #6
            RE: Headers in Datagrid spanning multiple columns.


            Hi Billy,

            I think what I originally suggested is a suitable solution.
            I have write a sample code to fulfill it.

            In HTML, add the datagrid into a table and set its width and height to
            100%, like this:

            <TABLE id="Table1" align="center" style="WIDTH: 464px; HEIGHT: 208px"
            cellSpacing="0" cellPadding="0"
            width="464" border="1" borderColor="#f f3366">
            <TR>
            <TD style="HEIGHT: 29px" align="center" colSpan="8">Off icial Impact
            Summary</TD>
            </TR>
            <TR>
            <TD style="WIDTH: 19.97%; HEIGHT: 107px" align="center"
            colSpan="2">abc defg</TD>
            <TD style="WIDTH: 37.5%; HEIGHT: 107px" align="center" colSpan="3">Pro gram
            Totals</TD>
            <TD style="WIDTH: 37.5%; HEIGHT: 107px" align="center"
            colSpan="3">Off icial Totals</TD>
            </TR>
            <TR>
            <TD style="HEIGHT: 29px" align="center" colSpan="8">
            <asp:DataGrid id="DataGrid1" runat="server" Width="100%"
            Height="100%"></asp:DataGrid></FONT>
            </TD>
            </TR>
            </TR>
            </TABLE>

            Then when you bind the data to the datagrid, it will generate what you want:

            SqlDataAdapter adapter=new SqlDataAdapter( "select * from
            jobs","server=l ocalhost;databa se=pubs;uid=sa; pwd=");
            DataSet ds=new DataSet();
            adapter.Fill(ds );
            DataGrid1.DataS ource=ds;
            DataGrid1.DataB ind();

            If you still can not produce out, I will attach my project for you.

            Hope this helps,
            Best regards,
            Jeffrey Tan
            Microsoft Online Partner Support
            Get Secure! - www.microsoft.com/security
            This posting is provided "as is" with no warranties and confers no rights.

            --------------------
            | Content-Class: urn:content-classes:message
            | From: "Billy Jacobs" <billnospam@csa .com>
            | Sender: "Billy Jacobs" <billnospam@csa .com>
            | References: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
            <x$Iw1PDfDHA.33 20@cpmsftngxa07 .phx.gbl>
            <0b5401c37e5c$0 16cbba0$a101280 a@phx.gbl>
            <l#K83PnfDHA.22 72@cpmsftngxa06 .phx.gbl>
            | Subject: RE: Headers in Datagrid spanning multiple columns.
            | Date: Fri, 19 Sep 2003 05:01:57 -0700
            | Lines: 26
            | Message-ID: <068c01c37ea5$d 35df680$a001280 a@phx.gbl>
            | MIME-Version: 1.0
            | Content-Type: text/plain;
            | charset="iso-8859-1"
            | Content-Transfer-Encoding: 7bit
            | X-Newsreader: Microsoft CDO for Windows 2000
            | Thread-Index: AcN+pdNdTL/p2eRNSV6WuLXcNj +doQ==
            | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
            | Newsgroups: microsoft.publi c.dotnet.genera l
            | Path: cpmsftngxa06.ph x.gbl
            | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109156
            | NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
            | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
            |
            | Sorry I meant that I need the headers to span a certain
            | number of columns as described here.
            |
            | I want to accomplish the following except with a datagrid.
            |
            | <Table>
            | <tr>
            | <td colspan=8>Offic ial Impact Summary</td>
            | </tr>
            | <tr>
            | <td colspan=2></td>
            | <td colspan=3>Progr am Totals</td>
            | <td colspan=3>Offic ial Totals</td>
            | </tr>
            | <tr> 'Here would be my bound rows.
            | <td>Col1Info</td><td>Col2Info </td><td>Col3Info </td>
            | <td>Col4Info</td><td>Col5Info </td><td>Col6Info </td>
            | <td>Col7Info</td><td>Col8Info </td>
            | </tr>
            | <tr>...</table>
            |
            |
            | Thanks,
            |
            | Billy Jacobs
            |
            |

            Comment

            • Billy Jacobs

              #7
              RE: Headers in Datagrid spanning multiple columns.

              Well this doesn't work. Even at design time the width of
              the parent table columns are different than those of the
              datagrid. So my column headers that span multiple columns
              don't span the columns correctly.

              Billy Jacobs.
              [color=blue]
              >-----Original Message-----
              >
              >Hi Billy,
              >
              >I think what I originally suggested is a suitable[/color]
              solution.[color=blue]
              >I have write a sample code to fulfill it.
              >
              >In HTML, add the datagrid into a table and set its width[/color]
              and height to[color=blue]
              >100%, like this:
              >
              ><TABLE id="Table1" align="center" style="WIDTH: 464px;[/color]
              HEIGHT: 208px"[color=blue]
              >cellSpacing="0 " cellPadding="0"
              >width="464" border="1" borderColor="#f f3366">
              ><TR>
              > <TD style="HEIGHT: 29px" align="center"[/color]
              colSpan="8">Off icial Impact[color=blue]
              >Summary</TD>
              ></TR>
              ><TR>
              > <TD style="WIDTH: 19.97%; HEIGHT: 107px"[/color]
              align="center"[color=blue]
              >colSpan="2">ab cdefg</TD>
              > <TD style="WIDTH: 37.5%; HEIGHT: 107px"[/color]
              align="center" colSpan="3">Pro gram[color=blue]
              >Totals</TD>
              > <TD style="WIDTH: 37.5%; HEIGHT: 107px"[/color]
              align="center"[color=blue]
              >colSpan="3">Of ficial Totals</TD>
              ></TR>
              ><TR>
              > <TD style="HEIGHT: 29px" align="center"[/color]
              colSpan="8">[color=blue]
              > <asp:DataGrid id="DataGrid1" runat="server"[/color]
              Width="100%"[color=blue]
              >Height="100%"> </asp:DataGrid></FONT>
              > </TD>
              ></TR>
              ></TR>
              ></TABLE>
              >
              >Then when you bind the data to the datagrid, it will[/color]
              generate what you want:[color=blue]
              >
              >SqlDataAdapt er adapter=new SqlDataAdapter( "select * from
              >jobs","server= localhost;datab ase=pubs;uid=sa ;pwd=");
              >DataSet ds=new DataSet();
              >adapter.Fill(d s);
              >DataGrid1.Data Source=ds;
              >DataGrid1.Data Bind();
              >
              >If you still can not produce out, I will attach my[/color]
              project for you.[color=blue]
              >
              >Hope this helps,
              >Best regards,
              >Jeffrey Tan
              >Microsoft Online Partner Support
              >Get Secure! - www.microsoft.com/security
              >This posting is provided "as is" with no warranties and[/color]
              confers no rights.[color=blue]
              >
              >--------------------
              >| Content-Class: urn:content-classes:message
              >| From: "Billy Jacobs" <billnospam@csa .com>
              >| Sender: "Billy Jacobs" <billnospam@csa .com>
              >| References: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
              ><x$Iw1PDfDHA.3 320@cpmsftngxa0 7.phx.gbl>
              ><0b5401c37e5c$ 016cbba0$a10128 0a@phx.gbl>
              ><l#K83PnfDHA.2 272@cpmsftngxa0 6.phx.gbl>
              >| Subject: RE: Headers in Datagrid spanning multiple[/color]
              columns.[color=blue]
              >| Date: Fri, 19 Sep 2003 05:01:57 -0700
              >| Lines: 26
              >| Message-ID: <068c01c37ea5$d 35df680$a001280 a@phx.gbl>
              >| MIME-Version: 1.0
              >| Content-Type: text/plain;
              >| charset="iso-8859-1"
              >| Content-Transfer-Encoding: 7bit
              >| X-Newsreader: Microsoft CDO for Windows 2000
              >| Thread-Index: AcN+pdNdTL/p2eRNSV6WuLXcNj +doQ==
              >| X-MimeOLE: Produced By Microsoft MimeOLE[/color]
              V5.50.4910.0300[color=blue]
              >| Newsgroups: microsoft.publi c.dotnet.genera l
              >| Path: cpmsftngxa06.ph x.gbl
              >| Xref: cpmsftngxa06.ph x.gbl[/color]
              microsoft.publi c.dotnet.genera l:109156[color=blue]
              >| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
              >| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
              >|
              >| Sorry I meant that I need the headers to span a[/color]
              certain[color=blue]
              >| number of columns as described here.
              >|
              >| I want to accomplish the following except with a[/color]
              datagrid.[color=blue]
              >|
              >| <Table>
              >| <tr>
              >| <td colspan=8>Offic ial Impact Summary</td>
              >| </tr>
              >| <tr>
              >| <td colspan=2></td>
              >| <td colspan=3>Progr am Totals</td>
              >| <td colspan=3>Offic ial Totals</td>
              >| </tr>
              >| <tr> 'Here would be my bound rows.
              >| <td>Col1Info</td><td>Col2Info </td><td>Col3Info </td>
              >| <td>Col4Info</td><td>Col5Info </td><td>Col6Info </td>
              >| <td>Col7Info</td><td>Col8Info </td>
              >| </tr>
              >| <tr>...</table>
              >|
              >|
              >| Thanks,
              >|
              >| Billy Jacobs
              >|
              >|
              >
              >.
              >[/color]

              Comment

              • Jeffrey Tan[MSFT]

                #8
                RE: Headers in Datagrid spanning multiple columns.


                Hi Billy,

                At design time, you add the datagrid into the table's bottom cell, then
                after
                setting the datagrid's width and height to 100%, the datagrid should fill
                in the
                cell.

                I have attached my project in this post.This project uses the sql server's
                default database to fill the datagrid.

                Best regards,
                Jeffrey Tan
                Microsoft Online Partner Support
                Get Secure! - www.microsoft.com/security
                This posting is provided "as is" with no warranties and confers no rights.

                --------------------
                | Content-Class: urn:content-classes:message
                | From: "Billy Jacobs" <billnospam@csa .com>
                | Sender: "Billy Jacobs" <billnospam@csa .com>
                | References: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
                <x$Iw1PDfDHA.33 20@cpmsftngxa07 .phx.gbl>
                <0b5401c37e5c$0 16cbba0$a101280 a@phx.gbl>
                <l#K83PnfDHA.22 72@cpmsftngxa06 .phx.gbl>
                <068c01c37ea5$d 35df680$a001280 a@phx.gbl>
                <rRdAFxOgDHA.15 48@cpmsftngxa06 .phx.gbl>
                | Subject: RE: Headers in Datagrid spanning multiple columns.
                | Date: Thu, 25 Sep 2003 20:09:32 -0700
                | Lines: 131
                | Message-ID: <00f701c383db$9 babf440$a001280 a@phx.gbl>
                | MIME-Version: 1.0
                | Content-Type: text/plain;
                | charset="iso-8859-1"
                | Content-Transfer-Encoding: 7bit
                | X-Newsreader: Microsoft CDO for Windows 2000
                | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
                | Thread-Index: AcOD25uruhFelYH 7TJSa+XyfQDgtjA ==
                | Newsgroups: microsoft.publi c.dotnet.genera l
                | Path: cpmsftngxa06.ph x.gbl
                | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:109972
                | NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
                | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
                |
                | Well this doesn't work. Even at design time the width of
                | the parent table columns are different than those of the
                | datagrid. So my column headers that span multiple columns
                | don't span the columns correctly.
                |
                | Billy Jacobs.
                |
                | >-----Original Message-----
                | >
                | >Hi Billy,
                | >
                | >I think what I originally suggested is a suitable
                | solution.
                | >I have write a sample code to fulfill it.
                | >
                | >In HTML, add the datagrid into a table and set its width
                | and height to
                | >100%, like this:
                | >
                | ><TABLE id="Table1" align="center" style="WIDTH: 464px;
                | HEIGHT: 208px"
                | >cellSpacing="0 " cellPadding="0"
                | >width="464" border="1" borderColor="#f f3366">
                | ><TR>
                | > <TD style="HEIGHT: 29px" align="center"
                | colSpan="8">Off icial Impact
                | >Summary</TD>
                | ></TR>
                | ><TR>
                | > <TD style="WIDTH: 19.97%; HEIGHT: 107px"
                | align="center"
                | >colSpan="2">ab cdefg</TD>
                | > <TD style="WIDTH: 37.5%; HEIGHT: 107px"
                | align="center" colSpan="3">Pro gram
                | >Totals</TD>
                | > <TD style="WIDTH: 37.5%; HEIGHT: 107px"
                | align="center"
                | >colSpan="3">Of ficial Totals</TD>
                | ></TR>
                | ><TR>
                | > <TD style="HEIGHT: 29px" align="center"
                | colSpan="8">
                | > <asp:DataGrid id="DataGrid1" runat="server"
                | Width="100%"
                | >Height="100%"> </asp:DataGrid></FONT>
                | > </TD>
                | ></TR>
                | ></TR>
                | ></TABLE>
                | >
                | >Then when you bind the data to the datagrid, it will
                | generate what you want:
                | >
                | >SqlDataAdapt er adapter=new SqlDataAdapter( "select * from
                | >jobs","server= localhost;datab ase=pubs;uid=sa ;pwd=");
                | >DataSet ds=new DataSet();
                | >adapter.Fill(d s);
                | >DataGrid1.Data Source=ds;
                | >DataGrid1.Data Bind();
                | >
                | >If you still can not produce out, I will attach my
                | project for you.
                | >
                | >Hope this helps,
                | >Best regards,
                | >Jeffrey Tan
                | >Microsoft Online Partner Support
                | >Get Secure! - www.microsoft.com/security
                | >This posting is provided "as is" with no warranties and
                | confers no rights.
                | >
                | >--------------------
                | >| Content-Class: urn:content-classes:message
                | >| From: "Billy Jacobs" <billnospam@csa .com>
                | >| Sender: "Billy Jacobs" <billnospam@csa .com>
                | >| References: <04c201c37a91$c 1909330$a401280 a@phx.gbl>
                | ><x$Iw1PDfDHA.3 320@cpmsftngxa0 7.phx.gbl>
                | ><0b5401c37e5c$ 016cbba0$a10128 0a@phx.gbl>
                | ><l#K83PnfDHA.2 272@cpmsftngxa0 6.phx.gbl>
                | >| Subject: RE: Headers in Datagrid spanning multiple
                | columns.
                | >| Date: Fri, 19 Sep 2003 05:01:57 -0700
                | >| Lines: 26
                | >| Message-ID: <068c01c37ea5$d 35df680$a001280 a@phx.gbl>
                | >| MIME-Version: 1.0
                | >| Content-Type: text/plain;
                | >| charset="iso-8859-1"
                | >| Content-Transfer-Encoding: 7bit
                | >| X-Newsreader: Microsoft CDO for Windows 2000
                | >| Thread-Index: AcN+pdNdTL/p2eRNSV6WuLXcNj +doQ==
                | >| X-MimeOLE: Produced By Microsoft MimeOLE
                | V5.50.4910.0300
                | >| Newsgroups: microsoft.publi c.dotnet.genera l
                | >| Path: cpmsftngxa06.ph x.gbl
                | >| Xref: cpmsftngxa06.ph x.gbl
                | microsoft.publi c.dotnet.genera l:109156
                | >| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
                | >| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
                | >|
                | >| Sorry I meant that I need the headers to span a
                | certain
                | >| number of columns as described here.
                | >|
                | >| I want to accomplish the following except with a
                | datagrid.
                | >|
                | >| <Table>
                | >| <tr>
                | >| <td colspan=8>Offic ial Impact Summary</td>
                | >| </tr>
                | >| <tr>
                | >| <td colspan=2></td>
                | >| <td colspan=3>Progr am Totals</td>
                | >| <td colspan=3>Offic ial Totals</td>
                | >| </tr>
                | >| <tr> 'Here would be my bound rows.
                | >| <td>Col1Info</td><td>Col2Info </td><td>Col3Info </td>
                | >| <td>Col4Info</td><td>Col5Info </td><td>Col6Info </td>
                | >| <td>Col7Info</td><td>Col8Info </td>
                | >| </tr>
                | >| <tr>...</table>
                | >|
                | >|
                | >| Thanks,
                | >|
                | >| Billy Jacobs
                | >|
                | >|
                | >
                | >.
                | >
                |

                Comment

                Working...