通过代码形式给combobox加text和value属性
来源:互联网 发布:ai软件好学吗 编辑:程序博客网 时间:2024/05/16 23:39
public class ComboxItem
{
public string Text = "";
public string Value = "";
public ComboxItem()
{
}
public ComboxItem(string _Text, string _Value)
{
Text = _Text;
Value = _Value;
}
public override string ToString()
{
return Text;
}
}
二.给控件绑定具有text和value的值
ComboxItem item = new ComboxItem();
item.Text = "执收单位";
item.Value = "BAS_ChargeAgency";
cboStats.Items.Add(item);
cboStats.DisplayMember = "Text";
cboStats.DisplayMember = "Value";
cboStats.SelectedIndex = 0;
三.当选择索引改变时如果获得所选项的value的值
if (cboStats.SelectedItem == null)
return;
string itemvalue =((ComboxItem) cboStats.SelectedItem).Value;
TreeViewLoad((object)itemvalue);
- 通过代码形式给combobox加text和value属性
- bcb combobox 加载text 和value
- ext combobox取value和text
- combobox 添加value值和Text值
- easyUI对combobox设置value和text
- select怎样加value和text值
- winform中的ComboBox同时设置text和value的方法
- 做个同时带Text和Value的ComboBox
- ComboBox怎么不绑定而设置Text和Value
- 做个同时带Text和Value的ComboBox
- 加了 runat="server"属性的select控件的value和text(实际值和显示文本)
- 通过jQuery来获取DropDownList的Text/Value属性值
- 通过css伪属性给div加小图标
- Ext.form.ComboBox 设置默认值 value 和text都有对应值
- 给 ComboBox.Text 赋值未必可靠
- comboBox绑定key和value
- C# 使用 DictionaryEntry 在WinForm中给 ComboBox 添加 Key 和 Value
- jQuery获取Select选中的Text和Value,根据Value值动态添加属性等
- SQL重复记录查询
- 对javascript匿名函数的理解(透彻版)
- svn学习笔记
- SQL开发中容易忽视的一些小地方(二)
- TFS Proxy 初体验
- 通过代码形式给combobox加text和value属性
- 基于Fragment,Loader,Actionbar的几个好文章转载 2
- 解决The selection is not within a valid module
- Flex 弹出窗口
- 深入理解I2C总线时序的模拟
- Windows应用程序编程接口------Windows API
- Managed(托管), Unmanaged(非托管), Native: What Kind of Code Is This?
- .net三层体系结构的简单理解
- 基于Fragment,Loader,Actionbar的几个好文章转载 3