View previous topic :: View next topic |
Author |
Message |
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2013 6:23 am Post subject: Rich text with multiline |
|
|
Hi,
I need to display multi line of rich text. Text could have bold, italic, image etc. Some cell may have multi line others could be single line, so it need to format accordingly.
Do you have any suggestions about best approach?
Thanks. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Jan 16, 2013 11:34 pm Post subject: |
|
|
You can use RichText - see the RichText sample code. To add multiple lines you use the \line markup. For example if I change the sample code to:
Code: | const string format = @"{\rtf1\ansi Part: \b \{0\}\line Second\par}"; |
This will add a second line to each row with the text "Second". You can find online guides to the RTF syntax but a simple approach is to just use Word pad to generate the required RTF and then open it in Notepad to see the codes.
If you are going to use multiline text then you will probably want to set the AutoFitHeight property on the RowBinding to true so that the rows will automatically expand to find the displayed text. _________________ Infralution Support |
|
Back to top |
|
|
Happs
Joined: 13 Jul 2011 Posts: 62 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2013 11:56 pm Post subject: |
|
|
Thanks for your prompt response, I will try your suggestions. |
|
Back to top |
|
|
|