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

[Solved] Using Themes

4 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 15 Jul 2009, 11:54 AM
I'm working on an app that uses CSS Themes.

We have a skin file that, in turn, points to an external stylesheet for the Grids that we use, using the SkinID="rad_grid". In addition, there is a skin file entry for the ComboBoxes we use.

If I set the grid up to use "NextPrevAndNumeric" paging the ComboBox doesn't render properly. I can make it render properly by intercepting the ItemCreated event in my code, looking for the creation of the PagerItem, finding the ComboBox control and the a) setting EnableEmbeddedSkins = "true" and b) setting the Skin name. I can't change the SkinID to use my in-built themed ComboBox skin 'cos you get an error telling you that it's only possible to set this property before the control is added to the container's control collection.

So, how do I get the out-of-the-box pager to use my Themed skin for the ComboBox?

--
Stuart

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Jul 2009, 12:37 PM
Hi Stuart,

RadControls, which are automatically created by RadGrid (such as pager RadComboBox, filtering RadDatePicker, etc) have the same skin name as the parent RadGrid. I am afraid you cannot change that.

So what you can do is supply CSS styles in your ASP.NET theme, which apply appropriate styles for the pager RadComboBox, bearing in mind the skin name that will be used.

Let me know if I am missing something.

Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stuart Hemming
Top achievements
Rank 2
answered on 15 Jul 2009, 01:19 PM
Hi Dimo,

I don't think you're missing anything.

The .skin file has this as an entry for the grid ...

<telerik:RadGrid runat="server"  GridLines="None" SkinId="rad_grid" EnableEmbeddedSkins="false" Skin="WebBlue"/> 

The implication of this and what you said, is that the ComboBox is going to use the WebBlue skin, yes?

[FX: time passes...]

Ah, I think I see the problem. Is it the case that the controls like the ComboBox inherit not just the skin name but also the value of EnableEmbeddedSkins and EnableEmbeddedBaseStylesheet? If it is, then the reason the ComboBox is not rendered is that we're not using an external stylesheet for them, so, when the system renders the ComboBoxes there are no images or CSS files for it to use.

Does that sound right?

--
Stuart


0
Accepted
Dimo
Telerik team
answered on 15 Jul 2009, 01:27 PM
Hi Stuart,

Yes, you are right. As I said, you cannot change the skin name of the autogenerated pager RadComboBox, but fortunately, you can change the value of its EnableEmbeddedSkins (and EnableEmbeddedBaseStyleSheet) properties at runtime (e.g. in the RadGrid ItemCreated event handler), so that the embedded skin is registered and applied.

Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stuart Hemming
Top achievements
Rank 2
answered on 15 Jul 2009, 01:31 PM
Cool.

Thanks Dimo.

--
Stuart
Tags
Grid
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or