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

Turn off htmlencode

1 Answer 171 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 23 Sep 2009, 07:46 AM
Hi,
I trying to put some html as text in a radcombobox but I cant figure out how to turn of the automatically htmlencode.
I'm binding my items codebehind:
RadComboBox radComboBoxStatuses = (RadComboBox)gridEditItem.FindControl("radComboBoxStatuses"); 
IList statuses = EnumHelper.ToLocalizedList(typeof(ActionPlanStatus), Resources.resources.ResourceManager); 
 
                        foreach (KeyValuePair<Enum,string> s in statuses) 
                        { 
                            RadComboBoxItem item = new RadComboBoxItem(); 
                             
                            item.Text = "<span class=\"activityStatus timeline_dataRow" + ActionPlanService.GetActivityStatusColor((ActionPlanStatus)s.Key) + "\"></span><span>" + s.Value + "</span>"
                            item.Value = s.Key.ToString(); 
                            radComboBoxStatuses.Items.Add(item); 
                        } 

 <telerik:RadComboBox ID="radComboBoxStatuses" runat="server" AllowCustomText="true" > 
</telerik:RadComboBox> 

/Mattias

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 23 Sep 2009, 07:43 PM
Hello Mattias,

RadComboBox uses HtmlEncode internally to encode Items' Texts and does not provide any means of switching this behavior off.

If you want to put HTML in Items to provide richer client-side appearance, please use Templates (demo/documentation).

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Mattias
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or