RE: DataGrid header and <TH>

Posted: 06-26-2003, 12:02 AM
Hello Vaclav,

You might use the HeaderStyle of the DataGrid which will create Th on the
client side. You can also attach style attribute to this
so you can format it the way you want. For more information refers to the
following documents:

DataGrid.HeaderStyle Property
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwebuiwebcontrolsdatagridclassheaderstyl etopic.asp

DataGrid.ShowHeader Property
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwebuiwebcontrolsdatagridclassshowheader topic.asp

Samples:
http://msdn.microsoft.com/library/de...us/cpqstart/ht
ml/cpsmpnetsamples-aspnetdataaccess.asp

Please let me know if you have any more questions on this.

Thanks,
Bassel Tabbara
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
| From: "Vaclav Jedlicka" <vjedlicka@iol.cz>
| Subject: DataGrid header and <TH>
| Date: Wed, 25 Jun 2003 12:11:40 +0200
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OKQ3cJwODHA.1364@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 195.47.25.99
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:154680
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello
|
| I have a DataGrid control an a page and I need the first row to have <TH>
| fields, not <TD>s, how can I achieve that?
| I need it because of a CSS which has attributes for <TH>s specified.
|
| Thanks in advance!
|
| Vaclav
|
|
|


Reply With Quote

Responses to "RE: DataGrid header and <TH>"

Bassel Tabbara [MSFT]
Guest
Posts: n/a
 
Re: DataGrid header and <TH>
Posted: 06-27-2003, 07:13 PM
Hello Vaclav,


DataGrid generates the styles tag if you enable GridLayout for the form
(which is the default). It uses the styles attribute to
Specify absolute positioning etc. If he does not want the Grid to generate
this then he will have to use a flow layout.

Please let me know if this answers your question.

Thanks,
Bassel Tabbara
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
| From: "Vaclav Jedlicka" <vjedlicka@iol.cz>
| References: <OKQ3cJwODHA.1364@TK2MSFTNGP10.phx.gbl>
<0uVASZ3ODHA.2496@cpmsftngxa06.phx.gbl>
| Subject: Re: DataGrid header and <TH>
| Date: Thu, 26 Jun 2003 09:34:34 +0200
| Lines: 91
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#dRnYW7ODHA.3700@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 195.47.25.99
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:155025
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thank you for your reply.
|
| I was not able to switch the header from <TD> to <TH>s, so I am trying to
| attach class attribute to the header and setup the style from the CSS
file.
|
| But here I encountered another problem. The <TABLE> element which renders
| the datagrid in the browser has a style attribute. This is what I get:
|
| <table class="browse" cellspacing="0" cellpadding="0" border="0"
| id="DataGrid1" style="border-collapse:collapse;">
|
| Unfortunately the style attribute interferes with the CSS settings from my
| CSS file. I need to get rid of it. When I save the page as HTML and remove
| it, everything is OK. But how can I make the datagrid not to produce it? I
| tried various settings. I also tried this code, but no success:
| DataGrid1.Style.Clear();
|
| I think the look and feel should be specified from the CSS files and not
| from the code, so the datagrid should not generate any style attributes.
| Vaclav
|
|
|
| ""Bassel Tabbara [MSFT]"" <basselt@online.microsoft.com> wrote in message
| news:0uVASZ3ODHA.2496@cpmsftngxa06.phx.gbl...
| > Hello Vaclav,
| >
| > You might use the HeaderStyle of the DataGrid which will create Th on
the
| > client side. You can also attach style attribute to this
| > so you can format it the way you want. For more information refers to
the
| > following documents:
| >
| > DataGrid.HeaderStyle Property
| >
|
http://msdn.microsoft.com/library/de...us/cpref/html/
| > frlrfsystemwebuiwebcontrolsdatagridclassheaderstyl etopic.asp
| >
| > DataGrid.ShowHeader Property
| >
|
http://msdn.microsoft.com/library/de...us/cpref/html/
| > frlrfsystemwebuiwebcontrolsdatagridclassshowheader topic.asp
| >
| > Samples:
| >
|
http://msdn.microsoft.com/library/de...us/cpqstart/ht
| > ml/cpsmpnetsamples-aspnetdataaccess.asp
| >
| > Please let me know if you have any more questions on this.
| >
| > Thanks,
| > Bassel Tabbara
| > Microsoft, ASP.NET
| >
| > This posting is provided "AS IS", with no warranties, and confers no
| rights.
| >
| >
| > --------------------
| > | From: "Vaclav Jedlicka" <vjedlicka@iol.cz>
| > | Subject: DataGrid header and <TH>
| > | Date: Wed, 25 Jun 2003 12:11:40 +0200
| > | Lines: 11
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <OKQ3cJwODHA.1364@TK2MSFTNGP10.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 195.47.25.99
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.aspnet:154680
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hello
| > |
| > | I have a DataGrid control an a page and I need the first row to have
| <TH>
| > | fields, not <TD>s, how can I achieve that?
| > | I need it because of a CSS which has attributes for <TH>s specified.
| > |
| > | Thanks in advance!
| > |
| > | Vaclav
| > |
| > |
| > |
| >
| >
|
|
|


Reply With Quote
 
LinkBack Thread Tools Search this Thread Display Modes
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Column Header Prabhu Kumar Maramreddy ASP.NET Building Controls 2 09-01-2003 03:50 PM
Fixed datagrid header, abacnet ASP.NET Data Grid Control 3 08-12-2003 01:17 AM
PreRender Datagrid Header Nagul ASP.NET Data Grid Control 0 07-26-2003 02:13 PM
DataGrid with image in the Column Header Mark ASP.NET Data Grid Control 1 07-17-2003 07:36 PM
how to check controls that on datagrid header Matt ASP.NET Data Grid Control 0 06-30-2003 01:55 PM