RadGrid没有使用浏览器窗口调整大小

时间:2016-11-11 13:07:27

标签: c# asp.net telerik

<%@ Page Language="C#" AutoEventWireup="true"        
MasterPageFile="~/Shared/Default.Master" CodeBehind="Test2Topics.aspx.cs" 
Inherits="Sec.Discussion.Test2Topics" %>
<%@ Register TagPrefix="AT" Namespace="RadTech.Web.UI" Assembly="RadTech.Web"   
%>
<%@ Register TagPrefix="AT" Namespace="Sec.Shared" Assembly="Sec" %>
<%@ MasterType TypeName="Sec.Shared.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="DefaultContent"    
runat="server">
<style type="text/css">
    #master-content-container { padding: 0px;height: 100%;overflow: hidden; }
</style>

<AT:RadSplitter ResizeWithBrowserWindow="true" ID="Test2Splitter"  
runat="server" SplitBarsSize="5" PanesBorderSize="0" LiveResize="true" 
Width="100%" Height="100%" ResizeWithParentPane="True" 
Orientation="Horizontal">
    <AT:RadPane Id="Test1TopicPane" runat="server" Height="45%" 
Scrolling="None">
        <div id="Test1TopicContainer" style="padding:12px;">
            <AT:Section ID="Test1TopicSubSection" runat="server">
                <Content>
                    <AT:SectionTitleRow ID="Test1TopicTitleRow" 
runat="server" ShowHelpLink="false"/>
                    <div>
                        <AT:RadRadGrid ID="Test1TopicGrid" height="250px"  
runat="server" IsListingGrid="true" EnableViewState="true" 
AutoGenerateColumns="false" GroupingEnabled="false" ShowGroupPanel="false" 
OnNeedDataSource="Test2Grid_NeedDataSource">
                            <MasterTableView HierarchyLoadMode="Client" 
AllowNaturalSort="false" DataKeyNames="TopicId">
                                <Columns>
                                    <telerik:GridBoundColumn 
DataField="TopicId" DataFormatString='<input type="radio" name="Test1TopicId" 
value="{0}" />'></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn 
DataField="Name"></telerik:GridBoundColumn>
                                </Columns>                                    
                            </MasterTableView>
                           <ClientSettings>
                               <Scrolling AllowScroll="True" 
UseStaticHeaders="true"/>

                          </ClientSettings>

                        </AT:RadRadGrid>
                    </div>
                </Content>
            </AT:Section>
        </div>
    </AT:RadPane>   
    <AT:RadSplitBar ID="SplitterBar" runat="server" CollapseMode="none" />
    <AT:RadPane Id="Test2TopicsPane" runat="server" Height="55%" 
 Scrolling="None">
        <div id="Test2TopicsContainer" style="padding:12px;">
            <AT:Section ID="Test2TopicsSubSection" runat="server">
                <Content>
                    <AT:SectionTitleRow ID="Test2TopicsTitleRow" 
runat="server" ShowHelpLink="false"/>
                    <div>
                        <AT:RadRadGrid ID="Test2TopicsGrid"  runat="server" 
IsListingGrid="true" EnableViewState="true" AutoGenerateColumns="false" 
GroupingEnabled="false" ShowGroupPanel="false" 
OnNeedDataSource="Test1Grid_NeedDataSource">
                            <MasterTableView HierarchyLoadMode="Client" 
AllowNaturalSort="false" DataKeyNames="TopicId">
                                <Columns>                                        
                                    <telerik:GridBoundColumn 
DataField="TopicId" DataFormatString='<input type="checkbox" 
name="Test2TopicIds" value="{0}" />'></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn 
DataField="Name"></telerik:GridBoundColumn>
                                </Columns>                                    
                            </MasterTableView>
                             <ClientSettings>
                               <Scrolling AllowScroll="True" 
UseStaticHeaders="true"/>
                          </ClientSettings>
                        </AT:RadRadGrid>
                    </div>
                </Content>
            </AT:Section>
        </div>
    </AT:RadPane>   
</AT:RadSplitter>  

</asp:Content>

我有上面的代码。我有两个网格,一个在上面,另一个在下面。如果浏览器窗口是固定的,但是当浏览器窗口变小时,这两个网格都很好看。滚动条不会根据窗口的大小调整大小,其他窗格也可以。任何人都可以提供解决方案。

1 个答案:

答案 0 :(得分:0)

尝试设置AllowColumnResize,ResizeGridOnColumnResize,AllowResizeToFit

A    50.5   52.9   51.8   52.7
B    50.7   52.7   51.4   52.7
C    50.7   52.7   51.4   52.8
D    50.8   52.9   51.6   52.6