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

Rad dock Scroll settings ?

3 Answers 150 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ashok kumar R
Top achievements
Rank 1
Ashok kumar R asked on 08 Jul 2009, 09:14 AM
I am wanting to have dock With Scroll and With Out scroll as configurable.  I have designed a Page to configure this height, width and scroll settings for each dock items. This docks are created dynamically during run time and the content is shown in the iframe. The height, width and scroll values is applied to both iframe and dock control as per this configurations but could not achieve the desired results.

as suggested in one of the forums, i included the following code to avoid scrolling for a particular dock.

dock.ContentContainer.Style.Add(HtmlTextWriterStyle.Overflow, "hidden"); 

The above code works fine but when we drag the dock, the scroll appears again. as suggested in another forum, i added the following overriding rdcontent code in ASPX but it makes all the docks as non scrollable.

<style type="text/css">    
    .rdContent  
    {     
        overflow: hidden !important;  
    }   
</style> 

3 Answers, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 09 Jul 2009, 01:41 PM
Hello Ashok,

You can choose to which RadDocks on the page the CSS class will be applied using the following code:

<style type="text/css"
    #RadDock1 .rdContent, #RadDock2 .rdContent 
    { 
        overflow: hidden !important; 
    } 
</style> 

"RadDock1" and "RadDock2" are the IDs of the respective docks to which the CSS class is applied.


This also can be done dynamically by adding the CSS class to a <style> tag. The source code below passes the CSS style to a <style> with an ID="dockStyles", by a LiteralControl in the Page_Load method:

.cs file
protected void Page_Load(object sender, EventArgs e) 
    LiteralControl con = new LiteralControl(); 
    con.Text = @"#" + RadDock1.ClientID + " .rdContent," + 
                "#" + RadDock2.ClientID + " .rdContent" + 
                    "{overflow: hidden !important;}"
    dockStyles.Controls.Add(con); 

.aspx file (in the <head> tag)
<style id="dockStyles" type="text/css" runat="server"
</style> 



Kind regards,
Pero
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
Ashok kumar R
Top achievements
Rank 1
answered on 13 Jul 2009, 08:46 AM
Hi Pero,

Thanks for your reply. This solution also enables the Dock to get loaded without Scroll in IE 6.0 ( and not in IE 7.0 ) but when we drag and drop it, the scroll appears again.  If we override the rdContent at client side, it disables the scroll in all the docks which is not intended result. Pl throw light on this.

regards,
Ashok

0
Accepted
Pero
Telerik team
answered on 16 Jul 2009, 07:05 AM
Hello Ashok,

I modified the My Portal example so that it applies CSS styles to certain docks (if a checkbox is checked). The styles are applied when the dock is added and then again on Page_Init. I save the applied CSS styles as a string in the Session. You can find the modified project attached to the thread.


Best wishes,
Pero
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.
Tags
Dock
Asked by
Ashok kumar R
Top achievements
Rank 1
Answers by
Pero
Telerik team
Ashok kumar R
Top achievements
Rank 1
Share this question
or