今天在使用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 添加值的更多相关文章

  1. 【转】Pandas学习笔记(三)修改&添加值

    Pandas学习笔记系列: Pandas学习笔记(一)基本介绍 Pandas学习笔记(二)选择数据 Pandas学习笔记(三)修改&添加值 Pandas学习笔记(四)处理丢失值 Pandas学 ...

  2. ComboBoxEdit 添加键值

    ComboBoxEdit combo = new ComboBoxEdit(); var coll = combo.Properties.Items; coll.BeginUpdate(); try ...

  3. c#devexpress GridContorl添加进度条

    demo 的实现图 下边是步骤和代码 1定义 时钟事件,定时的增加进度条的增量. 2:  添加进度条 3;定义字段属性 using System; using System.Collections.G ...

  4. sql server 自增长显式添加值

    如果想在自增列添加数据,会提示我们不能插入显式值 解决:

  5. vue中为对象添加值的问题

    demo: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...

  6. devexpress gridview 添加按钮

    #region 添加按钮事件 private RepositoryItemButtonEdit CreateRepositoryItemButtonEdit(Dictionary<object, ...

  7. js给kindeditor添加值

    需求:在点击回复按钮时,在kindeditor中添加被回复的用户昵称 html:<textarea name="content" id="mycontent&quo ...

  8. DevExpress 标题栏添加搜索功能

    上图是效果图 附件示例代码下载

  9. DevExpress gridcontrol添加了复选框删除选中的多行/批量删除的方法

    思路:遍历gridView1的每一行,该行中checkbox列被勾选则设置该行为选中状态,执行gridView1提供的DeleteSelectedRows方法则可 public void DoDele ...

随机推荐

  1. .NET面试题系列[10] - IEnumerable的派生类

    .NET面试题系列目录 IEnumerable分为两个版本:泛型的和非泛型的.IEnumerable只有一个方法GetEnumerator.如果你只需要数据而不打算修改它,不打算为集合插入或删除任何成 ...

  2. RBAC模型速记

    RBAC Model core concept: user,role,permission,operation,resource user has many roles, assign role to ...

  3. Redis系列(二)-Hredis客户端设计及开源

    接上篇c#实现redis客户端(一),重新整理些了下. 阅读目录: 项目说明 Hredis设计图 单元测试场景 总结 项目说明 背景:因为有地方要用,而又没找到对sentinel良好支持的Net客户端 ...

  4. 安装 mysql-5.7.5-m15-winx64

    win7 64位下如何安装配置mysql-5.7.5-m15-winx64 距离上次安装MySQL已经过去好久了.步骤这些,有可能会忘记.简单记录一下吧.(参考了一些网络上的博客.) 1.mysql- ...

  5. Java接口总结

    接口的定义: 使用interface来定义一个接口.接口定义与类的定义类似,也是分为接口的声明和接口体,其中接口体由变量定义和方法定义两部分组成,定义接口的基本语法如下: [修饰符] interfac ...

  6. 修改input框默认黄色背景

    input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { -webkit-box-shadow: 0 0 ...

  7. OpenCascade Primitives BRep-Cone

    OpenCascade Primitives BRep-Cone eryar@163.com Abstract. BRep is short for Boundary Representation. ...

  8. vue实例属性(vm.$els)

    不需要表达式 参数: id(必需) 用法: 为 DOM 元素注册一个索引,方便通过所属实例的 $els 访问这个元素. 注意: 因为 HTML 不区分大小写,camelCase 名字比如 v-el:s ...

  9. 《JS设计模式笔记》 3,观察者模式

    <script type="text/javascript"> //挂插着模式又叫发布订阅模式应该是最常用的模式 //1,dom事件就是观察者模式,只要订阅了click ...

  10. 理解DOM事件流的三个阶段

    本文主要解决两个问题: 1.什么是事件流 2.DOM事件流的三个阶段 事件流之事件冒泡与事件捕获 在浏览器发展的过程中,开发团队遇到了一个问题.那就是页面中的哪一部分拥有特定的事件? 可以想象画在一张 ...