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

Adding div to RadPane with height/width = 100%

2 Answers 142 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 30 Nov 2011, 11:59 AM
Hello,

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);
pane2.Controls.Add(contentDiv);

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%?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 30 Nov 2011, 01:22 PM
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,
Dobromir
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
0
JP
Top achievements
Rank 1
answered on 30 Nov 2011, 01:33 PM
Thanks, that does the trick!
Tags
Splitter
Asked by
JP
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
JP
Top achievements
Rank 1
Share this question
or