FineUI 官方论坛
标题:
界面放两个grid的填充问题
[打印本页]
作者:
~~疯狂~~
时间:
2013-7-5 22:17
标题:
界面放两个grid的填充问题
界面放了两个grid,根据情况从后台设置显示或隐藏,但是只有第一个grid能填充整个区域,第二个的高度没有填充。
[attach]2649[/attach]
[attach]2648[/attach]
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Content.aspx.cs" Inherits="WebServer.Root.Content" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="head_栏目" runat="server">
<title>栏目管理</title>
</head>
<body>
<form id="form_栏目" runat="server">
<x:PageManager ID="PageManager_栏目" AutoSizePanelID="RegionPanel_栏目" runat="server" />
<x:RegionPanel ID="RegionPanel_栏目" ShowBorder="false" runat="server" AutoScroll="True">
<Regions>
<x:Region ID="Region2" Split="true" EnableSplitTip="true" CollapseMode="Mini" Width="200px"
Margins="0 0 0 0" Title="栏目菜单" EnableLargeHeader="false" Icon="Outline"
EnableCollapse="true"
Position="Left" Layout="Fit" runat="server">
<Items>
<x:Tree ShowBorder="false" ShowHeader="false" OnNodeCommand="Tree_栏目_NodeCommand" ID="Tree_栏目" runat="server" OnNodeCheck="Tree_栏目_NodeCheck" AutoScroll="true">
</x:Tree>
</Items>
</x:Region>
<x:Region ID="mainRegion" ShowHeader="true" Title="栏目信息" Margins="0 0 0 0" Position="Center" AutoScroll="true" EnableBackgroundColor="true" Layout="Fit"
runat="server">
<Items>
<x:Grid ID="Grid_图片" Title="管理图片" PageSize="20" ShowBorder="false" AllowPaging="true" AllowSorting="true" Hidden="true"
OnPageIndexChange="Grid_图片_PageIndexChange" ShowHeader="False" runat="server"
EnableCheckBoxSelect="True" DataKeyNames="图片ID,图片标题" EnableRowNumber="True" OnSort="Grid_图片_Sort">
<Toolbars>
<x:Toolbar ID="Toolbar_工具栏_图片" runat="server">
<Items>
<x:Button ID="Button_添加_图片" Text="添加数据" Icon="Add" OnClick="Button_添加_图片_Click" runat="server">
</x:Button>
<x:Button ID="Button_删除_图片" Text="删除选中项" Icon="Delete" OnClick="Button_删除_图片_Click" EnablePostBack="true"
runat="server">
</x:Button>
<x:ToolbarFill ID="ToolbarFill2" runat="server">
</x:ToolbarFill>
<x:Button ID="Button_显示全部_图片" Text="显示全部" Icon="ShapesManySelect" OnClick="Button_显示全部_图片_Click" runat="server">
</x:Button>
<x:ToolbarSeparator ID="ToolbarSeparator2" runat="server" />
<x:Label ID="Label_关键字_图片" Text="关键字:" runat="server"></x:Label>
<x:TextBox ID="TextBox_关键字_图片" runat="server"></x:TextBox>
<x:Button ID="Button_查询_图片" Text="查询" Icon="SystemSearch" OnClick="Button_查询_图片_Click" runat="server">
</x:Button>
</Items>
</x:Toolbar>
</Toolbars>
<Columns>
<x:BoundField SortField="图片ID" DataField="图片ID" HeaderText="图片ID" />
<x:BoundField DataField="图片标题" SortField="图片标题" HeaderText="图片标题" />
<x:WindowField ColumnID="WindowField_编辑" WindowID="Window_添加编辑" HeaderText="编辑"
Icon="TableEdit" ToolTip="编辑" DataTextFormatString="{0}" DataIFrameUrlFields="图片ID"
DataIFrameUrlFormatString="~/Root/ImageAddEdit.aspx?id={0}" DataWindowTitleField="图片标题"
DataWindowTitleFormatString="编辑 - {0}" />
</Columns>
</x:Grid>
<x:Grid ID="Grid_内容" Title="管理内容" PageSize="20" ShowBorder="false" AllowPaging="true" AllowSorting="true" Hidden="true"
OnPageIndexChange="Grid_内容_PageIndexChange" ShowHeader="False" runat="server"
EnableCheckBoxSelect="True" DataKeyNames="内容ID,内容标题" EnableRowNumber="True" OnSort="Grid_内容_Sort">
<Toolbars>
<x:Toolbar ID="Toolbar_工具栏_内容" runat="server">
<Items>
<x:Button ID="Button_添加_内容" Text="添加数据" Icon="Add" OnClick="Button_添加_内容_Click" runat="server">
</x:Button>
<x:Button ID="Button_删除_内容" Text="删除选中项" Icon="Delete" OnClick="Button_删除_内容_Click" EnablePostBack="true"
runat="server">
</x:Button>
<x:ToolbarFill ID="ToolbarFill1" runat="server">
</x:ToolbarFill>
<x:Button ID="Button_显示全部" Text="显示全部" Icon="ShapesManySelect" OnClick="Button_显示全部_Click" runat="server">
</x:Button>
<x:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
<x:Label ID="Label1" Text="关键字:" runat="server"></x:Label>
<x:TextBox ID="TextBox_关键字" runat="server"></x:TextBox>
<x:Button ID="Button_查询" Text="查询" Icon="SystemSearch" OnClick="Button_查询_Click" runat="server">
</x:Button>
</Items>
</x:Toolbar>
</Toolbars>
<Columns>
<x:BoundField SortField="内容ID" DataField="内容ID" HeaderText="内容ID" />
<x:BoundField DataField="内容标题" SortField="内容标题" HeaderText="内容标题" />
<x:WindowField ColumnID="WindowField_编辑" WindowID="Window_添加编辑" HeaderText="编辑"
Icon="TableEdit" ToolTip="编辑" DataTextFormatString="{0}" DataIFrameUrlFields="内容ID"
DataIFrameUrlFormatString="~/Root/ContentAddEdit.aspx?id={0}" DataWindowTitleField="内容标题"
DataWindowTitleFormatString="编辑 - {0}" />
</Columns>
</x:Grid>
<x:Window ID="Window_添加编辑" Title="编辑" Popup="false" EnableIFrame="true" runat="server" EnableMaximize="true"
EnableConfirmOnClose="true" IFrameUrl="about:blank" OnClose="Window_添加编辑_Close"
CloseAction="HidePostBack" Target="Top" IsModal="True" Width="800px" Height="600px">
</x:Window>
</Items>
</x:Region>
</Regions>
</x:RegionPanel>
</form>
</body>
</html>
复制代码
if (栏目类型名称 == "内容")
{
Grid_图片.Hidden = true;
Grid_内容.Hidden = false;
Grid_内容.Width = Grid_图片.Width;
Grid_内容.Height = Grid_图片.Height;
绑定内容列表("栏目ID=" + e.NodeID);
}
else {
Grid_图片.Hidden = false;
Grid_内容.Hidden = true;
绑定图片列表("栏目ID=" + e.NodeID);
}
复制代码
作者:
~~疯狂~~
时间:
2013-7-5 22:18
有没有什么办法可以通过后台设置填充?
作者:
亮亮胖胖
时间:
2013-7-7 11:35
将这个两个Grid分别放到SimpleForm中,然后再SimpleForm中设置Grid填满。您这时只需要对SimpleForm进行显示或隐藏操作。这个涉及到Form的生命周期,好好研究下吧
作者:
~~疯狂~~
时间:
2013-7-12 09:16
亮亮胖胖 发表于 2013-7-7 11:35
将这个两个Grid分别放到SimpleForm中,然后再SimpleForm中设置Grid填满。您这时只需要对SimpleForm进行显示 ...
非常感谢,我试试!
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4