Dear Telerik-Staff,
I want to make my RadGrid occupy 100% of a RadPane's height, the grid is in.
I have taken the WebMail-Demo: The relevant part looks like this:
The AJAX-Code for the OnClientResized-Event looks like this:
I have a site containing my RadGrid (it is not nested into any other controls except the contentplaceholder) and on this site I add the following in the PageLoad-Event:
And finally the AjaxRequest-Event looks like this:
Now to my problem:
When I access the page the RadGrid doesn't occupy the total height of the rightPane. When clicking on the splitbar, the grid is resized properly in its height and width. So this perfectly works.
But I can't get it to run on the initial page load. When I call the RaisePostbackEvent of the AjaxManager the page crashes saying that a negative value for the width and height of the pane is not allowed (caused in the AjaxRequest-Event when subtracting 2 from the rightPane's width).
Then I did the following: Set the leftPane to Collapsed (Collapsed="true"). When accessing the page with this setting, the leftPane is collapsed and the Resized-Event is raised on initial page load. This works as expected but not if I have the leftPane set to Collapsed="false" on the initial PageLoad.
I hope that you can help me. I've spent the entire day trying to fix this. Do you have any idea for me??
Best regards,
Marco
I want to make my RadGrid occupy 100% of a RadPane's height, the grid is in.
I have taken the WebMail-Demo: The relevant part looks like this:
<
telerik:RadPane
runat
=
"server"
ID
=
"contentPane"
Scrolling
=
"none"
>
<
telerik:RadSplitter
runat
=
"server"
ID
=
"RadSplitter2"
BorderStyle
=
"None"
PanesBorderSize
=
"0"
>
<
telerik:RadPane
runat
=
"Server"
ID
=
"leftPane"
Width
=
"240px"
MinWidth
=
"240"
MaxWidth
=
"240"
Scrolling
=
"None"
>
<
telerik:RadSplitter
runat
=
"server"
ID
=
"RadSplitter3"
BorderStyle
=
"None"
PanesBorderSize
=
"0"
Height
=
"100%"
Orientation
=
"Horizontal"
>
<
telerik:RadPane
runat
=
"server"
ID
=
"topLeftPane"
>
<
div
class
=
"contentBorders"
>
<
asp:ContentPlaceHolder
ID
=
"ContentPlaceHolderNavigationModules"
runat
=
"server"
/>
</
div
>
</
telerik:RadPane
>
<
telerik:RadSplitBar
runat
=
"server"
ID
=
"RadSplitBar3"
CollapseMode
=
"Backward"
EnableResize
=
"false"
/>
<
telerik:RadPane
runat
=
"server"
ID
=
"bottomLeftPane"
Height
=
"68px"
>
<
telerik:RadPanelBar
runat
=
"server"
ID
=
"panelBarBottomLeft"
Width
=
"100%"
>
<
Items
>
---The Items
</
Items
>
</
telerik:RadPanelBar
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
telerik:RadPane
>
<
telerik:RadSplitBar
runat
=
"server"
ID
=
"RadSplitBar1"
CollapseMode
=
"Forward"
/>
<
telerik:RadPane
runat
=
"Server"
ID
=
"rightPane"
CssClass
=
"right-pane"
Scrolling
=
"Both"
OnClientResized
=
"ClientResized"
Height
=
"100%"
>
<
asp:ContentPlaceHolder
ID
=
"MainContent"
runat
=
"server"
/>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
The AJAX-Code for the OnClientResized-Event looks like this:
<
telerik:RadCodeBlock
ID
=
"codeBlock"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function ClientResized(sender, eventArgs) {
$find("<%= AjaxManagerMasterPage.ClientID %>").ajaxRequest('ChangePageSize');
}
</
script
>
</
telerik:RadCodeBlock
>
I have a site containing my RadGrid (it is not nested into any other controls except the contentplaceholder) and on this site I add the following in the PageLoad-Event:
AjaxManager = (RadAjaxManager)this.Master.Master.FindControl("AjaxManagerMasterPage");
AjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(AjaxManager_AjaxRequest);
AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, MyRadGrid, RadAjaxLoadingPanel1);
And finally the AjaxRequest-Event looks like this:
void AjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
switch (e.Argument.ToString())
{
case "ChangePageSize":
//Make the grid fit the full pane size
Unit masterPaneWidth = ((RadPane)this.Master.Master.FindControl("rightPane")).Width;
Unit masterPaneHeight = ((RadPane)this.Master.Master.FindControl("rightPane")).Height;
MyRadGrid.Width = new Unit(masterPaneWidth.Value - 2);
MyRadGrid.Height = new Unit(masterPaneHeight.Value - 2);
break;
}
}
Now to my problem:
When I access the page the RadGrid doesn't occupy the total height of the rightPane. When clicking on the splitbar, the grid is resized properly in its height and width. So this perfectly works.
But I can't get it to run on the initial page load. When I call the RaisePostbackEvent of the AjaxManager the page crashes saying that a negative value for the width and height of the pane is not allowed (caused in the AjaxRequest-Event when subtracting 2 from the rightPane's width).
Then I did the following: Set the leftPane to Collapsed (Collapsed="true"). When accessing the page with this setting, the leftPane is collapsed and the Resized-Event is raised on initial page load. This works as expected but not if I have the leftPane set to Collapsed="false" on the initial PageLoad.
I hope that you can help me. I've spent the entire day trying to fix this. Do you have any idea for me??
Best regards,
Marco