DevExpress控件之RepositoryItemComboBox

RepositoryItemComboBox在嵌入到GridView后,如何获取当前所选的Item?

直接代码:

 1 ((RepositoryItemComboBox)gridView.Columns["ColName"].ColumnEdit).SelectedIndexChanged += new System.EventHandler(ColName_SelectedIndexChanged);
2 3 private void ColName_SelectedIndexChanged(object sender, System.EventArgs e) 4 { 5 6    //获取所选item的索引 7 int i = ((DevExpress.XtraEditors.ComboBoxEdit)sender).SelectedIndex; 8    //获取所选item的内容 10    string currentItem=((DevExpress.XtraEditors.ComboBoxEdit)sender).EditValue.ToString(); 11 }

 

posted @ 2014-06-19 21:56  王小六Charles  阅读(1790)  评论(0编辑  收藏  举报