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 ...
随机推荐
- 使用Guava EventBus构建publish/subscribe系统
Google的Guava类库提供了EventBus,用于提供一套组件内publish/subscribe的解决方案.事件总线EventBus,用于管理事件的注册和分发.在系统中,Subscribers ...
- ASP.Net请求处理机制初步探索之旅 - Part 2 核心
开篇:上一篇我们了解了一个请求从客户端发出到服务端接收并转到ASP.Net处理入口的过程,这篇我们开始探索ASP.Net的核心处理部分,借助强大的反编译工具,我们会看到几个熟悉又陌生的名词(类):Ht ...
- Unity3D游戏开发初探—3.初步了解U3D物理引擎
一.什么是物理引擎? 四个世纪前,物理学家牛顿发现了万有引力,并延伸出三大牛顿定理,为之后的物理学界的发展奠定了强大的理论基础.牛顿有句话是这么说的:“如果说我看得比较远的话,那是因为我站在巨人的肩膀 ...
- The Similarities and Differences Between C# and Java -- Part 1(译)
原文地址 目录 介绍(Introduction) 相似点(Similarities) 编译单位(Compiled Units) 命名空间(Namespaces) 顶层成员(类型)(Top Level ...
- ubuntu下rhythmbox歌名显示乱码问题解决
问题描述:本人装有双系统,一个是win7,另一个是ubuntu12.04LTS版本,所有的歌曲都在windows磁盘下KuGou目录中,这个时候,使用ubuntu的rhythmbox播放的歌曲的时候, ...
- junit测试,使用classpath和file 加载文件的区别
用junit测试发现一个问题,怎么加载配置文件?一直都出现这样的错误 ERROR: org.springframework.test.context.TestContextManager - Caug ...
- jarsigner签名报错Invalid keystore format
由于之前在魅族市场的APK包都不是自己上传的,而是魅族从其他安卓市场帮拉去过来了. 所以需要我们自己去认领APK包. 这个时候就需要按照魅族给的未签名测试包给重新签名然后提交审核了. 1:看完以下说明 ...
- 阿里云centos7搭建wordpress环境
阿里云搭建wordpress系统 一.购买阿里云 二.安装php开发环境 1. https://www.apachefriends.org/zh_cn/index.html网站下载linux下的xam ...
- java 成长之路
分享总结 title: java 成长之路 tags: grammar_cjkRuby: true 经验差异 1-3年 要求 建议 3-5年 建议 5年+ 经验差异 最近一年比较忙,经历了创业公司的倒 ...
- BCP 数据的导入和导出
BCP 命令的参数很多,使用 -h 查看帮助信息,注意:参数是区分大小写的 使用BCP命令导出和导入数据常用的参数如下 bcp {[[database_name.][schema_name]].{ta ...