简体   繁体   English

如何在Asp.net中使用Ext.Net RadioGroup控件?

[英]How to use Ext.Net RadioGroup control in Asp.net?

I am learning to use Ext.Net . 我正在学习使用Ext.Net I cannot find a way to display an Ext.net RadioGroup items vertically. 我找不到垂直显示Ext.net RadioGroup项目的方法。 Even when I set Vertical="true" , the RadioGroup is not displayed vertically. 即使设置了Vertical="true" ,RadioGroup也不会垂直显示。

Please see a sample markup: 请参阅示例标记:


<ext:Panel ID="PanelDaily" runat="server" Title="Daily">
    <Items>
        <ext:RadioGroup ID="RadioGroup2"  runat="server" Vertical="true">
            <Items>
                <ext:Radio ID="Radio1" FieldLabel="" runat="server" BoxLabel="Every Hour(s)" Checked="true"/>
                <ext:Radio ID="Radio2" FieldLabel="" runat="server" BoxLabel="At" />
            </Items>
        </ext:RadioGroup>
    </Items>
</ext:Panel>

How to diplay an Ext.net RadioGroup control items vertically? 如何垂直显示Ext.net RadioGroup控件项?

The .Vertical property is used in conjunction with the .ColumnsNumber property. .Vertical属性与.ColumnsNumber属性结合使用。 Setting Vertical="true" affects how the Items are distributed in the Columns during Render. 设置Vertical="true"会影响在渲染过程中项目在列中的分布方式。

From the ExtJS docs: 从ExtJS文档:

Ext.form.RadioGroup Ext.form.RadioGroup

True to distribute contained controls across columns, completely filling each column top to bottom before starting on the next column. 如果为True,则将包含的控件分布到各列,在从下一列开始之前,将所有列从上到下完全填充。 The number of controls in each column will be automatically calculated to keep columns as even as possible. 每列中的控件数量将自动计算,以使列尽可能保持一致。 The default value is false, so that controls will be added to columns one at a time, completely filling each row left to right before starting on the next row. 默认值为false,因此控件将一次添加到一列,从左到右完全填充每一行,然后再开始下一行。

The following simple diagrams demonstrate the difference in the ordering of Items within the Columns. 以下简单图说明了列中项目顺序的不同。

// ColumnsNumber="2"
// Vertical="false" <-- default value

1    6
2    7
3    8 
4    9 
5

// ColumnsNumber="2"
// Vertical="true"

1    2
3    4
5    6
7    8
9

Here's a full sample demonstrating use of the .ColumnsNumber and .Vertical properties. 这是一个完整的示例,演示了如何使用.ColumnsNumber.Vertical属性。

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

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

    <ext:Panel 
        runat="server" 
        Title="Example" 
        Width="350" 
        Height="215"
        Padding="5">
        <Items>
            <ext:RadioGroup runat="server" ColumnsNumber="2" Vertical="true">
                <Items>
                    <ext:Radio runat="server" BoxLabel="Purple" />
                    <ext:Radio runat="server" BoxLabel="Yellow" />
                    <ext:Radio runat="server" BoxLabel="Green" />
                    <ext:Radio runat="server" BoxLabel="Blue" />
                    <ext:Radio runat="server" BoxLabel="Red" />
                    <ext:Radio runat="server" BoxLabel="Orange" />
                    <ext:Radio runat="server" BoxLabel="Black" />
                </Items>
            </ext:RadioGroup>
        </Items>
    </ext:Panel>
</form>
</body>
</html>

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM