DataGrid header and <TH>

Ask a Question related to ASP.NET General, Design and Development.

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

    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" <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
    |
    |
    |


    Bassel Tabbara [MSFT] Guest

  2. Similar Questions and Discussions

    1. extra datagrid header...
      I was wondering if there is a way I can add an extra header to a datagrid? I found this solution on the internet - but it seems quite old and...
    2. Removing the datagrid header.....
      How to remove the datagrid header display ? Which property I should change ? Thanks
    3. datagrid header
      Is it possible to have an overall header that spans across all columns? An example would be a class schedule for student Ben. |Ben |English ...
    4. get more control on datagrid header (?)
      Dear all, I add more header's row on runtime using ItemCreate() and add DataGridItem(0, 0, ListItemType.Header) to get more header row. and...
    5. Fixed datagrid header,
      Hi eveybody, I have a datagrid that can show many rows, so there is a vertical scrollbar. The problem is that when users scroll down, they loose...
  3. #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" <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
    | >
    |
    [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" <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
    | > |
    | > |
    | > |
    | >
    | >
    |
    |
    |


    Bassel Tabbara [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may 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