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

Radlistbox

1 Answer 36 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 25 Feb 2010, 10:18 PM
Hi,

I do the following and my radlistbox truncates the values displayed in my listbox.

List

 

<String> strReportItemsList = new List<String>();

strReportItemsList.Add(

"Bala<12");

 

strReportItemsList.Add(

"Bala<ce");

 

strReportItemsList.Add(

"Bala<ce ref");

 

strReportItemsList.Add(

"test12");

 

strReportItemsList.Add(

"test?123");

 

 

m_radReportLstBox.DataSource = strReportItemsList;

m_radReportLstBox.DataBind();

 

 

 
When you execute this code,
 in my radlistbox , I get the first item to be correctly dispalyed but the 2nd("Bala<ce" ) and 3rd items  gets truncated and only "bala" gets displayed . Pls clarify this.

Am I missing something?

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Feb 2010, 08:26 AM
Hello Ayesha,

If you’re using >, < and & characters as part of your text property you should always encode them as their entity counterparts. Otherwise, a browser may think you’re starting a tag or entity and mess things up. Hence you can try either of &lt; or &#60 instead of these symbols to achieve the required.

C#:
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        List <String> strReportItemsList = new List<String>(); 
 
        strReportItemsList.Add("@Bala&#6012"); 
        strReportItemsList.Add("Bala&#60ce"); 
        strReportItemsList.Add("Bala&lt;ce ref"); 
 
        RadListBox1.DataSource = strReportItemsList; 
        RadListBox1.DataBind(); 
    } 

Regards,
Shinu.
Tags
ListBox
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or