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

Overriding default width for RadPanelBar

2 Answers 177 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 21 Jul 2008, 04:35 PM
Hi there,

I have just created a custom skin for the RadPanelBar and spent the last few hours trying to override the default "width: 250px;" property in the top-level PanelBar.css file.  Finally I remembered the "!important" marker and now it is working.  However, a few questions:

1)  Why is there a default width in pixels in the first place?  Won't this almost always need to be overridden?

2)  In which directory is the file where this is being set?  I tracked down the PanelBar.css file in my D:\Program Files (x86)\telerik\RadControls for ASPNET AJAX Q1 2008\Skins directory as well as the local version I was using for the project, and set each to be different from the default; but every time the default width was restored (after emptying the browser's cache, too).  Firebug shows that the the CSS is coming from a WebResource.axd style-sheet file -- is this hard-coded in the DLL somehow?

3)  The WebResource.axd style-sheet file seems to be linked in at the end of the <head> section, after my custom-skin CSS files.  If I could somehow have my custom CSS linked in after the default CSS, my styles would naturally override the defaults -- is this possible somehow?

Thanks in advance,

Ed Graham

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 24 Jul 2008, 10:58 AM
Hi Ed,

You can override the default width of the RadPanelBar with the following CSS rule (thus, removing the !important declaration):
div.RadPanelBar 
    width:200px

The stylesheets in WebResource.axd are embedded in the assembly - there are two of them for almost every control - one base stylesheet that sets common styles for the given control, and one for the specified skin - both can be disabled using the EnableEmbeddedBaseStylesheet and the EnableEmbeddedSkins properties.

Regarding your first question - the specified width is simply the default one and can be easily overridden using the Width property of the RadPanelBar.

Greetings,
Alex
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ed
Top achievements
Rank 1
answered on 24 Jul 2008, 12:24 PM
A comprehensive answer, Alex; thanks very much indeed.  In all the excitement of using skins etc. I had forgotten about the plain old Width property!

Cheers,

Ed
Tags
PanelBar
Asked by
Ed
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Ed
Top achievements
Rank 1
Share this question
or