【C#】【DevExpress】获取当前单元格类型

 1 private void gridView1_ShownEditor(object sender, System.EventArgs e) {
 2     GridView gridView = sender as GridView;
 3     if (gridView != null && gridView.ActiveEditor != null) {
 4         object activeEditor = gridView.ActiveEditor;
 5         if (activeEditor is TextEditEditor) {
 6             // 文本编辑器
 7         } else if (activeEditor is DateEditEditor) {
 8             // 日期编辑器
 9         } else if (activeEditor is RepositoryItemComboBox) {
10             // 下拉列表编辑器
11             RepositoryItemComboBox comboBox = activeEditor as RepositoryItemComboBox;
12             Type itemType = comboBox.Items[comboBox.SelectedIndex].GetType();
13             // 获取下拉列表选中项的类型
14         }
15         // 更多类型检查... PictureEdit 图片类型
16     }
17 }

 

posted @ 2024-10-21 14:57  陆陆无为而治者  阅读(3)  评论(0编辑  收藏  举报