Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Vertical Text on WebDataGrid's Header

Hi everyone,

I'm trying to have vertical text on my WebDataGrid's headers (It only has to work with IE).

So I first created the following entry in my css:





th {



: tb-rl;



: fliph() flipV();


Then I added such a template in my webdatagrid:











<cc1:ItemTemplate ID="wdgResultsTemplate1" runat="server" TemplateID="VerticalHeader" >



<asp:Label ID="Label12" runat="server" Text="vertic" CssClass="VertiColumn" ></asp:Label >







And finally I specified the TemplateId in the header of one column as shown below:




ig:BoundDataField DataFieldName="REINS_SYSTEM" Key="REINS_SYSTEM" Width="35px">



<Header Text="System" TemplateId="VerticalHeader" />

I got an error message saying that I can't have a label in a template.

It seems that I'm off track, could someone redirect me on the right track. I'm not at ease with the templates and the templates collection in the WebDataGrid ;-(

Thanks in advance ! I'll be reactive to give you more details if you ask ;-)

Thanks again !




  • 33839
    Suggested Answer

    Hey Yvan,

    Your problem is in how you define your template.  The actual html or control code needs to be insdie of a <Template> tag in the item template.

                     <cc1:ItemTemplate ID="WebDataGrid1Template1" runat="server"
                             <asp:Label ID="Label12" runat="server" Text="vertic" CssClass="VertiColumn" ></asp:Label >

    So once you place your label inside a further <Template> tag, it should work.  The one thing I had to change was your css class definition.  I had to take the 'th' part of it out.  Since you're applying it to a label, it's put on a span, not the th. 

    Hope this helps out!



    David Young