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" <
[email protected]>
| Sender: "Billy Jacobs" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<l#
[email protected]>
<
[email protected]>
<
[email protected]>
| Subject: RE: Headers in Datagrid spanning multiple columns.
| Date: Thu, 25 Sep 2003 20:09:32 -0700
| Lines: 131
| Message-ID: <
[email protected]>
| 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: AcOD25uruhFelYH7TJSa+XyfQDgtjA==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109972
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| 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="#ff3366">
| ><TR>
| > <TD style="HEIGHT: 29px" align="center"
| colSpan="8">Official Impact
| >Summary</TD>
| ></TR>
| ><TR>
| > <TD style="WIDTH: 19.97%; HEIGHT: 107px"
| align="center"
| >colSpan="2">abcdefg</TD>
| > <TD style="WIDTH: 37.5%; HEIGHT: 107px"
| align="center" colSpan="3">Program
| >Totals</TD>
| > <TD style="WIDTH: 37.5%; HEIGHT: 107px"
| align="center"
| >colSpan="3">Official Totals</TD>
| ></TR>
| ><TR>
| > <TD style="HEIGHT: 29px" align="center"
| colSpan="8">
| > <asp
ataGrid id="DataGrid1" runat="server"
| Width="100%"
| >Height="100%"></asp
ataGrid></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=localhost;database=pubs;uid=sa;pwd=");
| >DataSet ds=new DataSet();
| >adapter.Fill(ds);
| >DataGrid1.DataSource=ds;
| >DataGrid1.DataBind();
| >
| >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" <
[email protected]>
| >| Sender: "Billy Jacobs" <
[email protected]>
| >| References: <
[email protected]>
| ><
[email protected]>
| ><
[email protected]>
| ><l#
[email protected]>
| >| Subject: RE: Headers in Datagrid spanning multiple
| columns.
| >| Date: Fri, 19 Sep 2003 05:01:57 -0700
| >| Lines: 26
| >| Message-ID: <
[email protected]>
| >| 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.public.dotnet.general
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.general:109156
| >| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| >| X-Tomcat-NG: microsoft.public.dotnet.general
| >|
| >| 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>Official Impact Summary</td>
| >| </tr>
| >| <tr>
| >| <td colspan=2></td>
| >| <td colspan=3>Program Totals</td>
| >| <td colspan=3>Official 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
| >|
| >|
| >
| >.
| >
|