Adding div to RadPane with height/width = 100%

3 posts, 1 answers
  1. JP
    JP avatar
    120 posts
    Member since:
    Aug 2011

    Posted 30 Nov 2011 Link to this post


    I want to add a div to a RadPane. This Div is target of a LoadingPanel because the content of the div is dynamic.

    This is the div:
    HtmlGenericControl contentDiv = new HtmlGenericControl("div");
    contentDiv.Style.Add("width", "100%");
    contentDiv.Style.Add("height", "100%");

    This is the RadPane:
    RadPane pane2 = new RadPane();
    pane2.ID = "Pane2";
    pane2.Height = new Unit(100, UnitType.Percentage);
    pane2.Width = new Unit(100, UnitType.Percentage);

    The RadSplitter also has a height of 100%. The parent container has a fixed width.
    The height of the RadPanes is ok, but the contentDiv doesn't fill the whole RadPane, because this is rendered:

    <div id="RAD_SPLITTER_PANE_CONTENT_Pane2" style="overflow-x: auto; overflow-y: auto; height: 598px; width: 1210px; ">
    <div id="ContentPanel1Panel" style="display: block; ">
    <div id="ContentPanel1" style="width:100%;height:100%;"></div>

    As you can see, the contentDiv produces 2 divs when it gets added to the RadPane. The first div has no width/height set, so the next div doesn't work as expected. What can I do that the automatically generated "ContentPanel1Panel" also has height/width = 100%?

  2. Answer
    Dobromir avatar
    1633 posts

    Posted 30 Nov 2011 Link to this post

    Hello Jp,

    Correct me if I am wrong but I believe that the <div> with ID ContentPanel1 is updated using RadAjaxManager - RadAjaxManager wraps the updated controls with <div> elements using the pattern UpdateControlIDPanel. If this is the case, you need to set UpdatePanelHeight property to the AjaxUpdatedControl, e.g.:
    <telerik:AjaxUpdatedControl ControlID="ContentPanel1" UpdatePanelHeight="100%" />

    This property will configure the wrapper div to have 100% height set.

    If this is not the case, could you please provide more detailed information on the specific scenario?

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. JP
    JP avatar
    120 posts
    Member since:
    Aug 2011

    Posted 30 Nov 2011 Link to this post

    Thanks, that does the trick!
Back to Top