DevExpress ComboBoxEdit List绑定二级选择下拉表
来源:互联网 发布:知乎恐怖提问 编辑:程序博客网 时间:2024/06/08 05:07
功能:其他下拉框会随着第一个变动而变动
Xaml
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
<dxlc:LayoutGroup >
<dxlc:LayoutItem Width="150" Label="设备类型">
<dxe:ComboBoxEdit Name="deviceTypeList" EditValue="{Binding DeviceTypes,UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding DeviceTypeList}" DisplayMember="DeviceType" ValueMember="DeviceType" IsTextEditable="False" >
</dxe:ComboBoxEdit>
</dxlc:LayoutItem>
<dxlc:LayoutItem Width="250" Label="设备名称">
<dxe:ComboBoxEdit Background="{x:Null}" IsEnabled="True" ItemsSource="{Binding ElementName=deviceTypeList,Path=SelectedItem.DeviceNames}" EditValue="{Binding SelectedNameList, Mode=TwoWay}" >
<dxe:ComboBoxEdit.StyleSettings>
<dxe:CheckedComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>
</dxlc:LayoutItem>
<dxlc:LayoutItem Width="250" Label="设备属性">
<dxe:ComboBoxEdit IsEnabled="True" ItemsSource="{Binding ElementName=deviceTypeList,Path=SelectedItem.TagNames}" EditValue="{Binding SelectedTypeList, Mode=TwoWay}" >
<dxe:ComboBoxEdit.StyleSettings>
<dxe:CheckedComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
DisplayMember="DeviceType" 是显示GetDataStoreDeviceTypeRet对象中DeviceType属性的值
ValueMember="DeviceType" 是绑定GetDataStoreDeviceTypeRet对象中DeviceType属性的值
ElementName=deviceTypeList,Path=SelectedItem.DeviceNames ElementName绑定name为deviceTypeList的控件,Path是绑定了name为deviceTypeList的控件选择的具体对象的DeviceNames 属性
.cs
//设备类型绑定的 ItemsSource
public List<GetDataStoreDeviceTypeRet> DeviceTypeList
{
get
{
return _deviceTypeList;
}
set
{
_deviceTypeList = value;
OnPropertyChanged();
}
}
//对象
public class GetDataStoreDeviceTypeRet
{
public string DeviceType { get; set; }
public List<string> DeviceNames { get; set; }
public List<string> TagNames { get; set; }
}
- DevExpress ComboBoxEdit List绑定二级选择下拉表
- DevExpress:下拉框绑定数据源 (ComboBoxEdit,LookUpEdit)
- DevExpress:grid中绑定下拉框ComboBoxEdit,只带显示
- DevExPress控件中ComboBoxEdit动态绑定数据
- WPF DevExpress ComboBoxEdit 实现键值绑定,输入字符自动匹配
- DevExpress.XtraEditors.ComboBoxEdit 只能选择不能在里面 输入数据
- DevExpress ComboBoxEdit 实现 键值
- DevExpress ComboBoxEdit 实现 键值
- DevExpress ComboBoxEdit 实现 键值
- Devexpress中ComboBoxEdit的使用
- devExpress:gridview 中绑定下拉框
- DevExpress LookUpEdit和ComboBoxEdit 的用法
- C# devexpress comboboxedit Textedit 只读不可输入
- devExpress:gridview 中绑定下拉框 (示例)
- ComboBoxEdit
- DevExpress GridControl List绑定方式下新增行的方法
- DEV组件LookupEdit,ComboBoxEdit绑定数据源
- DEV组件LookupEdit,ComboBoxEdit绑定数据源
- Android设置之UI篇
- bzoj 2791 [Poi2012]Rendezvous 倍增lca 基环树
- Discarding record on action DISCARD on error 1403
- json数据表单回填
- VB里面的Line方法的具体使用方法
- DevExpress ComboBoxEdit List绑定二级选择下拉表
- Android源码中的组合模式
- LeetCode No.120 Triangle
- Uiautomator之python封装包安装
- 一步一步用 java 设计生成二维码
- c#用IMessageFilter拦截键盘消息
- android事件分发机制的再学习
- 对 caffe 中Xavier, msra 权值初始化方式的解释
- mongo db(用 mongo VUE windows) 仅查询某个字段且不为空的所有值