MultiLine datagrid header
-
How can I do this. I use \n in the header. But it doesn't show the second line. thanks in advance.
-
How can I do this. I use \n in the header. But it doesn't show the second line. thanks in advance.
You need to use html to affect the layout when rendered to the browser, so in this case you should use either
or...
. You will probably find if you view the source of your page that it has put the newline in there but, as the browser will ignore the newline, it doesn't do you much good. HTH
-
You need to use html to affect the layout when rendered to the browser, so in this case you should use either
or...
. You will probably find if you view the source of your page that it has put the newline in there but, as the browser will ignore the newline, it doesn't do you much good. HTH
sorry I forgot to say, I need to do this in C# windows application.
-
sorry I forgot to say, I need to do this in C# windows application.
Right I've managed to munge a work around for this. Perform the following steps: 1). Add a TableStyle to the table styles collection for the datagrid (I just left the defaults on for this). 2). On the actual datagrid (not the table style you just created), change the HeaderFont size property to something bigger (16 got me two lines of text). 3). Use
\n
to add line breaks. This should sort you out. Let me know if you can't get it working and i will post some a demo for you. HTH -
Right I've managed to munge a work around for this. Perform the following steps: 1). Add a TableStyle to the table styles collection for the datagrid (I just left the defaults on for this). 2). On the actual datagrid (not the table style you just created), change the HeaderFont size property to something bigger (16 got me two lines of text). 3). Use
\n
to add line breaks. This should sort you out. Let me know if you can't get it working and i will post some a demo for you. HTHthat works. Thanks a lot
-
that works. Thanks a lot
No problem, but it should be noted that this is not a very nice way of fixing things. I'm sure if you made this an ownerdrawn control and handled the painting yourself, you could fix things without having to trick the control about the font-size. Although, i suppose compared to just twiddling a couple of properties it's a lot more hassle doing things properly :)