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

Problem During Rendering of HTML Tag text on Rad Combobox

3 Answers 331 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 29 Nov 2010, 10:55 AM
Hi,
I went through one problem In radCombobox,I have tables in which I am saving HTML tag text like <I>Test</I>,So when this text binded on RadCombobox then Selected Text display with HTML Tags But I want that I should render HTML automatically and display the text in italic mode,We tried one solutions where we used Itema Templated inside radcombobox its seems to work that time when I Open the combobox that time all html tags get render but when I close combobox then seletedt item display with HTML tags,Please tell me how to solve this?Your help will be highly appreciated.

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 29 Nov 2010, 02:14 PM
Hello Rahul,

If you are passing the HTML content in the DataTextField property, then it will always show the HTML content in the RadComboBox when selected because the RadComboBox uses a textbox to display it's text property. Is that what you are doing, even when using the ItemTemplate?
0
Rahul Khinvasara
Top achievements
Rank 1
answered on 29 Nov 2010, 02:44 PM
Hi ,
Thanks for your reply,We used this code for RadCombo box: 
  <telerik:RadComboBox ID="radTest" CausesValidation="false" runat="server" Skin="Office2007" SkinsPath="~/RadControls/ComboBox/Skins" Width="200px" HighlightTemplatedItems="true" DropDownWidth="300" Visible="false" >
                              <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "TextValue") %>
                             </ItemTemplate>
 </telerik:RadComboBox>

and In Code behind we bind dataset to this combo,So When I open dropdown then All text displayed the text with rendered HTML
but as I close the dropdown then Selected text display with all HTML tags,Please suggest me what to do?
               Your help will be highly appreciated.

Thanks
0
Kalina
Telerik team
answered on 03 Dec 2010, 10:56 AM
Hi Rahul Khinvasara,

I am afraid that by default RadComboBox encodes the text displayed in the input, so there is no option to see html in it.
If you populate the control with data that contains html tags, and you set the ValidateRequest property of the Page to "false" - you will see these tags in the input but they will look like a text string.
I made a simplified example in order to show you what happens in this case.

Best wishes,
Kalina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Rahul Khinvasara
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or