zoukankan      html  css  js  c++  java
  • dev下拉框选择不同值显示不同控件

    单列的ASPxFormLayout直接前台控制就可以了,多列的前台控制后会出现空白

    <dx:LayoutItem Caption="内容类型" Height="40px">
    <LayoutItemNestedControlCollection>
    <dx:LayoutItemNestedControlContainer runat="server">
    <dx:ASPxComboBox ID="ComboBoxType" runat="server" OnSelectedIndexChanged="ComboBoxType_SelectedIndexChanged" AutoPostBack="true" Width="80%"><Items>
    <dx:ListEditItem Text="函数" Value="1" />
    <dx:ListEditItem Text="实物" Value="2" />
    </Items>
    </dx:ASPxComboBox>
    </dx:LayoutItemNestedControlContainer>
    </LayoutItemNestedControlCollection>
    <CaptionSettings HorizontalAlign="Right" VerticalAlign="Middle" />
    </dx:LayoutItem>

    前台设置AutoPostBack="true" 

    var type = ComboBoxType.Text;
    LayoutGroup layg = ASPxFormLayout1.Items[0] as LayoutGroup;
    LayoutItem layi = layg.Items[2] as LayoutItem;
    if (type == "11")
    {
    layi.Visible = true;
    }
    else
    {
    layi.Visible = false;
    }

  • 相关阅读:
    05mybatis配置方式简单入门
    04mybatis配置文件lombok组件使用
    03mybatis-注解方式简单入门实例
    01-02 ssm框架简介
    jsp实现文件上传
    新增的语义化标签
    html5与html4的区别
    面向对象总结
    html语法
    购物车总结
  • 原文地址:https://www.cnblogs.com/heyiping/p/10980639.html
Copyright © 2011-2022 走看看