Rad dock Scroll settings ?

4 posts, 1 answers
  1. Ashok kumar R
    Ashok kumar R avatar
    4 posts
    Member since:
    Jul 2009

    Posted 08 Jul 2009 Link to this post

    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> 
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 09 Jul 2009 Link to this post

    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.
  3. Ashok kumar R
    Ashok kumar R avatar
    4 posts
    Member since:
    Jul 2009

    Posted 13 Jul 2009 Link to this post

    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

  4. Answer
    Pero
    Admin
    Pero avatar
    1156 posts

    Posted 16 Jul 2009 Link to this post

    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.
Back to Top