Professional Web Applications Themes

DataGrid header and <TH> - ASP.NET General

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 doents: DataGrid.HeaderStyle Property [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url] frlrfsystemwebuiwebcontrolsdatagridclassheaderstyl etopic.asp DataGrid.ShowHeader Property [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url] frlrfsystemwebuiwebcontrolsdatagridclassshowheader topic.asp Samples: [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/ht[/url] 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" <vjedlickaiol.cz> | Subject: DataGrid header and <TH> | Date: ...

  1. #1

    Default RE: DataGrid header and <TH>

    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 doents:

    DataGrid.HeaderStyle Property
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]
    frlrfsystemwebuiwebcontrolsdatagridclassheaderstyl etopic.asp

    DataGrid.ShowHeader Property
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]
    frlrfsystemwebuiwebcontrolsdatagridclassshowheader topic.asp

    Samples:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/ht[/url]
    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" <vjedlickaiol.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.1364TK2MSFTNGP10.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
    |
    |
    |


    Bassel Tabbara [MSFT] Guest

  2. #2

    Default Re: DataGrid header and <TH>

    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" <vjedlickaiol.cz>
    | References: <OKQ3cJwODHA.1364TK2MSFTNGP10.phx.gbl>
    <0uVASZ3ODHA.2496cpmsftngxa06.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.3700tk2msftngp13.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]"" <basseltonline.microsoft.com> wrote in message
    | news:0uVASZ3ODHA.2496cpmsftngxa06.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 doents:
    | >
    | > DataGrid.HeaderStyle Property
    | >
    |
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]
    | > frlrfsystemwebuiwebcontrolsdatagridclassheaderstyl etopic.asp
    | >
    | > DataGrid.ShowHeader Property
    | >
    |
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/[/url]
    | > frlrfsystemwebuiwebcontrolsdatagridclassshowheader topic.asp
    | >
    | > Samples:
    | >
    |
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/ht[/url]
    | > 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" <vjedlickaiol.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.1364TK2MSFTNGP10.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
    | > |
    | > |
    | > |
    | >
    | >
    |
    |
    |


    Bassel Tabbara [MSFT] Guest

Similar Threads

  1. Droplist in Header of DataGrid. Possible?
    By hoosierprogrammer@yahoo.com in forum ASP.NET Data Grid Control
    Replies: 5
    Last Post: September 7th, 09:23 PM
  2. Having 2-row customized header within the DataGrid
    By Martin Raychev in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: March 2nd, 02:59 PM
  3. datagrid header
    By Cambridgeways in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: January 24th, 04:31 AM
  4. Edit DataGrid Header
    By Mike Smith in forum ASP.NET Data Grid Control
    Replies: 4
    Last Post: September 21st, 07:35 PM
  5. PreRender Datagrid Header
    By Nagul in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: July 26th, 02:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139