Skin for ItemTemplate in RadComboBox

4 posts, 0 answers
  1. Anna
    Anna avatar
    2 posts
    Member since:
    Nov 2012

    Posted 21 Nov 2012 Link to this post

    Hello,

    I used the following code to generate items inside a RadComboBox

    <telerik:RadComboBox ID="SearchComboBox" runat="server" Skin="Office2007">
       <ItemTemplate>
          <%# DataBinder.Eval(Container.DataItem,"Name") %>
       </ItemTemplate>
    </telerik:RadComboBox>

    SearchComboBox.DataSource = dataTable;
    SearchComboBox.DataTextField = "Name";
    SearchComboBox.DataValueField = "ID";
    SearchComboBox.DataBind();

    My problem is it seems that any items inside the <ItemTemplate> tag does not inherit or use the css styles defined on RadComboBox's Skin attribute. The items are generated but there's no background color changes (onmouseover) on the items.

    is there a way for the items to be able to use the defined skin?

    Thanks
  2. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 26 Nov 2012 Link to this post

    Hi, Anna.

    That shouldn't be happening e.g. the items should receive a hover class, even if they are template items.

    For instance the server side templates demo -- http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx does have templates, much like your case and has hovering.

    Which leads me to believe that there might be something in your projects that prevents the items from being hovered, or overrides their looks.

    Which version of the controls are you using? I am asking so I could create a simple example with item templates and test locally to see if the problem exists. If can't produce the problem locally, I will send you the example, so you could test in in your environment.

    Regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anna
    Anna avatar
    2 posts
    Member since:
    Nov 2012

    Posted 29 Nov 2012 Link to this post

    I think it's Q3 2011 SP1.
    Thanks Ivan.

  5. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 05 Dec 2012 Link to this post

    Hi, Anna.

    In order to have the templates items hovered, you need to set the HighlightTemplateItems property to true e.g.:

    <telerik:RadComboBox ID="SearchComboBox" runat="server" Skin="Office2007"
        HighlightTemplatedItems="true">
        <ItemTemplate>
            <%# DataBinder.Eval(Container.DataItem,"Name") %>
        </ItemTemplate>
    </telerik:RadComboBox>

    Regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top