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

Style RadDock with css?

1 Answer 140 Views
Dock
This is a migrated thread and some comments may be shown as answers.
David Ahlbaum
Top achievements
Rank 2
David Ahlbaum asked on 11 Nov 2008, 03:36 PM
Hi!

I´m having trouble styling my radDock items.

Heres the markup:
<div id="radDock1" class="raddock RadDock_Gray rdCollapsed span-6" style="width:300px;">

I want to set the width with my css-class (span-6) but it get overriden by the inline style width: 300px. Where does this come from? ! can´t get rid of it. I´ve tried:

    protected void Page_Load(object sender, EventArgs e)
    {
        radDockZone2.Style.Add("background", "url(App_Themes/DarkGray/Images/grid.png)");
        radDock1.Style.Remove("width");
        radDock1.Style.Clear();        
    }

and even:

    protected void RadDock_OnPreRender(object sender, EventArgs e)
    {
        RadDock dockItem = (RadDock)sender;
        dockItem.Style.Clear();
        radDock1.Style.Clear();
    }

I don´t want my radDock 300 pixles wide and I don´t wan´t to set it with the Width property. What to do?

Kind regards David

PS The first line in my Page_Load sets the background in the radDockZone. is there a better way of doing this? DS





1 Answer, 1 is accepted

Sort by
0
Petko
Telerik team
answered on 11 Nov 2008, 08:25 PM
Hi David,

If you want to override the style that is already set, use the "!important" rule after the style value. For changing the color of RadDockZone and the width of RadDock (without using the "width" property of RadDock) you can override the CSS classes of RadDockZone and RadDock. More information about this you can find here. I prepared a small sample for you that shows how to achieve this:

ASPX:
<head id="Head1" runat="server">  
    <style type="text/css">  
    .raddockzone  
    {  
        background-color:Red !important;  
    }  
    .raddock  
    {  
        width: 100px !important;  
    }  
    </style> 
 </head> 
<body> 
    <form id="form1" runat="server" > 
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div style="width:300px">  
     <telerik:RadDockLayout Id="RadDockLayout1" runat="server">  
         <telerik:RadDockZone ID="RadDockZone1" runat="server">  
            <telerik:RadDock ID="RadDock1" runat="server"></telerik:RadDock> 
         </telerik:RadDockZone> 
     </telerik:RadDockLayout> 
    </div> 
    </form> 
</body> 

Hope this helps you.

All the best,
Petko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
David Ahlbaum
Top achievements
Rank 2
Answers by
Petko
Telerik team
Share this question
or