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

Skin for ItemTemplate in RadComboBox

3 Answers 146 Views
SkinManager
This is a migrated thread and some comments may be shown as answers.
Anna
Top achievements
Rank 1
Anna asked on 21 Nov 2012, 07:48 AM
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

3 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 26 Nov 2012, 07:54 AM
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.
0
Anna
Top achievements
Rank 1
answered on 29 Nov 2012, 06:54 AM
I think it's Q3 2011 SP1.
Thanks Ivan.

0
Ivan Zhekov
Telerik team
answered on 05 Dec 2012, 09:19 AM
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.
Tags
SkinManager
Asked by
Anna
Top achievements
Rank 1
Answers by
Ivan Zhekov
Telerik team
Anna
Top achievements
Rank 1
Share this question
or