Problem During Rendering of HTML Tag text on Rad Combobox

4 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 29 Nov 2010 Link to this post

    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.
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 29 Nov 2010 Link to this post

    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?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 29 Nov 2010 Link to this post

    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
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 03 Dec 2010 Link to this post

    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.
Back to Top