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
85
Vertical Text on WebDataGrid's Header
posted

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:

 

 

.VertiColumn

 

th {

writing-mode

 

: tb-rl;

filter

 

: fliph() flipV();

}

Then I added such a template in my webdatagrid:

 

 

 

 

 

 

 

<Templates>

 

 

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

 

 

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

 

 

</cc1:ItemTemplate>

 

 

</Templates>

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 !

Yvan

 

 

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    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.


                 <Templates>
                     <cc1:ItemTemplate ID="WebDataGrid1Template1" runat="server"
                         TemplateID="Template1">
                         <Template>
                             <asp:Label ID="Label12" runat="server" Text="vertic" CssClass="VertiColumn" ></asp:Label >
                         </Template>
                     </cc2:ItemTemplate>
                 </Templates>

    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!

     

    regards,

    David Young

Children
No Data