This is a migrated thread and some comments may be shown as answers.

Formatting text in PanelBar items with newlines

2 Answers 101 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Frank Grimes
Top achievements
Rank 1
Frank Grimes asked on 15 Jan 2010, 10:11 PM
Is there a way to make a PanelBar item display text formatted with newline/carriage returns? I am currently building my text string to be displayed with the proper formatting:

string itemText = "Some text on line 1" + Environment.NewLine + "Some text on line 2";
RadPanelItem item = new RadPanelItem();
item.text = itemText;

I am expecting the item to be displayed as:

Some text on line 1
Some text on line 2

However, everything is shown on one line until the width of the item has been reached and the text then just wraps around:

Some text on line 1Some tex
t on line 2

This is a minor content formatting issue in my application, but is it possible?

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 18 Jan 2010, 10:33 AM
Hi Steven Rosaria,

I used <br /> in my application for formatting the text with new line. Give a try with following code.

CS:
 
  string itemText = "Some text on line 1 <br />Some text on line 2"
  RadPanelItem item1 = new RadPanelItem(); 
  item1.Text = itemText; 
  RadPanelBar2.Items.Add(item1); 

Regards,
Shinu.
0
Frank Grimes
Top achievements
Rank 1
answered on 18 Jan 2010, 12:41 PM
Of course, I forgot that this was being rendered as HTML. In any case, your suggestion worked. Thanks!
Tags
PanelBar
Asked by
Frank Grimes
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Frank Grimes
Top achievements
Rank 1
Share this question
or