(Radcontrol学习笔记)第七篇:如何让RadSplitBar控件最大化(类似framework的效果)

本文介绍如何配置RadSplitter控件实现全屏布局,包括设置HTML和BODY标签的高度为100%,移除页面滚动条等技巧,并提供了一个完整的示例代码。

Splitter - Resize with Window

Click here for a full window example.

A common scenario in the use of RadSplitter control is when itsWidth and Height properties are set to 100% - you needa complete page layout control from the splitter.

If you have problems to resize the splitter in a full page height here is the followingchecklist:

  • make sure the <HTML> tag has its height set to 100% and its margin set to0px


  • make sure the <BODY> tag has its height set to 100% and its margin set to0px


  • make sure any elements that are embedding the splitter control also has thoseproperties set
    <div id="ParentDivElement" style="height: 100%;">

  • Optionally in order your page to be standards compliant you can set the DOCTYPE directive to:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">

  • Optionally you can also remove the page scrollbars so the application is as closeto the desktop environment as possible:
    <body scroll="no" >

Here is a cross-browser compatible code example of a page that contains a splittercontrol which is filling the entire page size:

Note: To hide the initial resize of the splitter from the end userand to get a better visual result you should set VisibleDuringInit="false"
<%@Page Language="VB" AutoEventWireup="true" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>FullWindow</title>
    <styletype="text/css">
    html, body, form
    {
        height: 100%;
        margin: 0px;
        padding: 0px;
        overflow: hidden;
    }
    </style>
</head>
<body>
    <formid="form2" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server"/>
        <div id="ParentDivElement"style="height: 100%;">
            <telerik:RadSplitter ID="MainSplitter" runat="server"Height="100%" Width="100%"
                Orientation="Horizontal" Skin="Outlook">
                <telerik:RadPane ID="TopPane"runat="server" Height="100" MinHeight="85" MaxHeight="150"
                    Scrolling="none">
                    <!--Place the content of the pane here -->
                </telerik:RadPane>
                <telerik:RadSplitBar ID="RadsplitbarTop" runat="server"CollapseMode="Forward" />
                <telerik:RadPane ID="MainPane" runat="server"Scrolling="none" MinWidth="500">
                    <telerik:RadSplitter ID="NestedSplitter" runat="server"Skin="Outlook" LiveResize="true">
                        <telerik:RadPane ID="LeftPane" runat="server"Width="200" MinWidth="150" MaxWidth="400">
                            <!--Place the content of the pane here -->
                        </telerik:RadPane>
                        <telerik:RadSplitBar ID="VerticalSplitBar" runat="server"CollapseMode="Forward" />
                        <telerik:RadPane ID="ContentPane" runat="server">
                            <!--Place the content of the pane here -->
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </telerik:RadPane>
            </telerik:RadSplitter>
        </div>
    </form>
</body>
</html>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值