Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Ext.net的LayoutColumn中添加多个项_C#_Html_Layout_Formatting_Ext.net - Fatal编程技术网

C# 在Ext.net的LayoutColumn中添加多个项

C# 在Ext.net的LayoutColumn中添加多个项,c#,html,layout,formatting,ext.net,C#,Html,Layout,Formatting,Ext.net,我试图创建两个不同的列,在每个列中我希望有多个项目。例如,一个组合框和一列中的两个日期字段 我发布了代码,当我试图运行它时,它会告诉我“此集合中只允许一个组件”时,会出现错误 我不能100%确定您试图配置的布局,但最好避免使用布局控件,因为它们已从Ext.NET 2中删除。您可以使用.Layout属性 以下示例演示如何使用.Layout属性替换布局控件 示例 <%@ Page Language="C#" %> <!DOCTYPE html> <html&g

我试图创建两个不同的列,在每个列中我希望有多个项目。例如,一个组合框和一列中的两个日期字段

我发布了代码,当我试图运行它时,它会告诉我“此集合中只允许一个组件”时,会出现错误



我不能100%确定您试图配置的布局,但最好避免使用布局控件,因为它们已从Ext.NET 2中删除。您可以使用.Layout属性

以下示例演示如何使用.Layout属性替换布局控件

示例

<%@ Page Language="C#" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title>Ext.NET Example</title>
</head>
<body>
    <form runat="server">   
        <ext:ResourceManager runat="server" />

        <ext:TabPanel runat="server">
            <Items>
                <ext:Panel runat="server" Title="Step 1">
                    <Items>
                        <ext:Panel
                            runat="server" 
                            Title="Step 1: Choose date span and set spans" 
                            Region="North"
                            Height="200" 
                            Width="475"
                            MinWidth="225" 
                            MaxWidth="475">
                            <Items>
                                <ext:Container runat="server" Layout="ColumnLayout" Height="200">
                                    <Items>
                                        <ext:RadioGroup runat="server" Selectable="true" ColumnsNumber="1" >
                                            <Items>
                                                <ext:Radio runat="server" BoxLabel="Show All" InputValue="0" />
                                                <ext:Radio runat="server" BoxLabel="Choose Date Range(By Month)" InputValue="1" />
                                                <ext:Radio runat="server" BoxLabel="Choose Date Range(By Dates)" InputValue="2" />
                                            </Items>
                                        </ext:RadioGroup>
                                        <ext:ComboBox 
                                            runat="server" 
                                            Selectable="true" 
                                            SelectedIndex="0" 
                                            StyleSpec="margin-bottom:4px;" 
                                            Width="200">
                                            <Items>
                                                <ext:ListItem Text="Any Month" Value="0" />
                                                <ext:ListItem Text="January" Value="1" />   
                                                <ext:ListItem Text="February" Value="2" />
                                                <ext:ListItem Text="March" Value="3" />
                                                <ext:ListItem Text="April" Value="4" />
                                                <ext:ListItem Text="May" Value="5" />
                                                <ext:ListItem Text="June" Value="6" />
                                                <ext:ListItem Text="July" Value="7" />
                                                <ext:ListItem Text="August" Value="8" />
                                                <ext:ListItem Text="September" Value="9" />
                                                <ext:ListItem Text="October" Value="10" />
                                                <ext:ListItem Text="November" Value="11" />
                                                <ext:ListItem Text="December" Value="12" />
                                            </Items>
                                        </ext:ComboBox>
                                        <ext:DateField
                                            runat="server"
                                            FieldLabel="Start"
                                            AnchorHorizontal="100%"
                                            EnableKeyEvents="true"
                                            Width="200"
                                            />
                                        <ext:DateField 
                                            runat="server" 
                                            FieldLabel="End"
                                            AnchorHorizontal="100%"
                                            EnableKeyEvents="true"
                                            Width="200"
                                            />
                                    </Items>
                                </ext:Container>
                            </Items>
                        </ext:Panel>
                    </Items>

                </ext:Panel>
                <ext:Panel runat="server" Title="Step 2"/>
            </Items>
        </ext:TabPanel> 
    </form>
</body>
</html>

Ext.NET示例

把东西装在一个容器里就行了

<ext:Container 
    runat="server" 
    Width="600" 
    Height="300" 
    Layout="ColumnLayout">
    <Items>
        <ext:RadioGroup runat="server" ColumnWidth="0.5">
            <Items>
                <ext:Radio runat="server" BoxLabel="1" />
                <ext:Radio runat="server" BoxLabel="2" />
            </Items>
        </ext:RadioGroup>
        <ext:Container runat="server" ColumnWidth="0.5">
            <Items>
                <ext:ComboBox runat="server" />
                <ext:DateField runat="server" />
                <ext:DateField runat="server" />
            </Items>
        </ext:Container>
    </Items>
</ext:Container>


您是否正在使用母版页?如果不是,你不能用
“一些内容…”来完成同样的事情吗一些内容我试图实现的是第一列中的RadioGroup,第二列中的ComboBox和2个DateFields。这能实现吗?正是我所需要的。现在我完全理解了容器的工作原理!非常感谢
<ext:Container 
    runat="server" 
    Width="600" 
    Height="300" 
    Layout="ColumnLayout">
    <Items>
        <ext:RadioGroup runat="server" ColumnWidth="0.5">
            <Items>
                <ext:Radio runat="server" BoxLabel="1" />
                <ext:Radio runat="server" BoxLabel="2" />
            </Items>
        </ext:RadioGroup>
        <ext:Container runat="server" ColumnWidth="0.5">
            <Items>
                <ext:ComboBox runat="server" />
                <ext:DateField runat="server" />
                <ext:DateField runat="server" />
            </Items>
        </ext:Container>
    </Items>
</ext:Container>