DevExpress ComboBoxEdit 添加值
今天在使用ComboBoxEdit 这个控件的时候,不知道怎么添加值.
在官网上找到代码。在这里做个记录
ComboBoxEdit combo = new ComboBoxEdit();
ComboBoxItemCollection coll = combo.Properties.Items;
coll.BeginUpdate();
try {
coll.Add(new PersonInfo("Sven", "Petersen"));
coll.Add(new PersonInfo("Cheryl", "Saylor"));
coll.Add(new PersonInfo("Dirk", "Luchte"));
}
finally {
coll.EndUpdate();
}
combo.SelectedIndex = -; Controls.Add(combo); //... public class PersonInfo {
private string _firstName;
private string _lastName; public PersonInfo(string firstName, string lastName) {
_firstName = firstName;
_lastName = lastName;
} public override string ToString() {
return _firstName + " " + _lastName;
}
}
public class ExComboBox
{
public int Index { get; set; }
public string Key { get; set; }
public string Value { get; set; }
public string Tag { get; set; } public ExComboBox(int pIndex, string pKey, string pValue)
{
this.Index = pIndex;
this.Key = pKey;
this.Value = pValue;
} public ExComboBox(int pIndex, string pKey, string pValue, string pTag)
{
this.Index = pIndex;
this.Key = pKey;
this.Value = pValue;
this.Tag = pTag;
}
public override string ToString()
{
return this.Value;
}
}
comboBox.Properties.Items.Add("全部");
for (int i = ; i < arg.Result.Count; i++)
{
comboBox.Properties.Items.Add(new ExComboBox(i, arg.Result[i].F_RoadwayCode, arg.Result[i].F_StationCode.ToString()));
}
void comboBoxEditStation_SelectedValueChanged(object sender, System.EventArgs e)
{
var exComboBox1 = this.comboBoxEditRoadWay.SelectedItem as ExComboBox;
}
DevExpress ComboBoxEdit 添加值的更多相关文章
- 【转】Pandas学习笔记(三)修改&添加值
Pandas学习笔记系列: Pandas学习笔记(一)基本介绍 Pandas学习笔记(二)选择数据 Pandas学习笔记(三)修改&添加值 Pandas学习笔记(四)处理丢失值 Pandas学 ...
- ComboBoxEdit 添加键值
ComboBoxEdit combo = new ComboBoxEdit(); var coll = combo.Properties.Items; coll.BeginUpdate(); try ...
- c#devexpress GridContorl添加进度条
demo 的实现图 下边是步骤和代码 1定义 时钟事件,定时的增加进度条的增量. 2: 添加进度条 3;定义字段属性 using System; using System.Collections.G ...
- sql server 自增长显式添加值
如果想在自增列添加数据,会提示我们不能插入显式值 解决:
- vue中为对象添加值的问题
demo: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- devexpress gridview 添加按钮
#region 添加按钮事件 private RepositoryItemButtonEdit CreateRepositoryItemButtonEdit(Dictionary<object, ...
- js给kindeditor添加值
需求:在点击回复按钮时,在kindeditor中添加被回复的用户昵称 html:<textarea name="content" id="mycontent&quo ...
- DevExpress 标题栏添加搜索功能
上图是效果图 附件示例代码下载
- DevExpress gridcontrol添加了复选框删除选中的多行/批量删除的方法
思路:遍历gridView1的每一行,该行中checkbox列被勾选则设置该行为选中状态,执行gridView1提供的DeleteSelectedRows方法则可 public void DoDele ...
随机推荐
- 剑指Offer面试题:22.二叉搜索树的后序遍历序列
一.题目:二叉搜索树的后序遍历序列 题目:输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果.如果是则返回true,否则返回false.假设输入的数组的任意两个数字都互不相同. 例如在下面 ...
- Three.js + HTML5 Audio API 打造3D音乐频谱,Let’s ROCK!
继续玩味之前写的音乐频谱作品,将原来在Canvas标签上的 作图利用Three.js让它通过WebGL呈现,这样就打造出了一个全立体感的频谱效果了. 项目详情及源码 项目GitHub地址:https: ...
- 几个常用Json组件的性能测试
上一篇文章中我已经介绍了JsonBuilder方案的整体思路以及一个版本的雏形代码,他现在已经是可以使用的了,但是因为是实时反射的,所以效率并不高. 鉴于几位博友对Json转换组件的性能有兴趣,我先放 ...
- JavaScript利用replace更改所有符合条件字符
利用replace替换字符串时,在正常使用情况下默认只能更改匹配到的第一个字符 var a=new String("fffffddd"); console.log(a.replac ...
- WCF学习之旅——第一个WCF示例(二)
第四步:通过自我寄宿的方式寄宿服务 WCF服务需要依存一个运行着的进程(宿主),服务寄宿就是为服务指定一个宿主的过程.WCF是一个基于消息的通信框架,采用基于终结点(Endpoint)的通信手段. 终 ...
- 深入学习jQuery选择器系列第三篇——过滤选择器之索引选择器
× 目录 [1]通用形式 [2]首尾索引 [3]奇偶索引[4]范围索引 前面的话 上一篇介绍了过滤选择器中的子元素选择器部分,本文开始介绍极易与之混淆的索引选择器 通用形式 $(':eq(index) ...
- 1、NoSQL概述
最近抽时间把Redis学了一下,所以就在网上找了一些资料.然后找到尚硅谷-周阳老师的视频教程,觉得里面的讲的挺好.所以就把他视频当中的资料教程整理出来. 单机MySQL的美好时代 在90年代,一个网站 ...
- UWP开发之Mvvmlight实践四:{x:bind}和{Binding}区别详解
{x:bind}是随着UWP被推出而被添加的,可以说是Win10 UWP开发专有扩展.虽然 {x:Bind} 缺少{Binding} 中的一些功能,但它运行时所花费的时间和使用的内存量均比 {Bind ...
- bootstrap 学习总结
Bootstrap 是最受欢迎的 HTML.CSS 和 JS 框架,用于开发响应式布局.移动设备优先的 WEB 项目.当前最新版本是3.2.0; 使用的第一步,可以直接复制官方的模版,另存为index ...
- Difference Between HashMap and IdentityHashMap--转
原文地址:https://dzone.com/articles/difference-between-hashmap-and Most of the time I use HashMap whenev ...