2012-05-20 102 views
0

在gridcontrol devexpress中,我将“employee_id”列显示为组合框。我想将EMPLOYEES表中的数据填入gridcontrol devexpress中的“employee_id”列中。谢谢。获取数据到gridview devexpress

+0

请不要使用全大写。 –

+0

什么平台?赢,ASP,WPF,SL? – Mikhail

回答

0

我建议你处理GridView.ShownEditor事件。在此事件处理程序中,您可以获取当前显示的列编辑器的克隆,并过滤其项目。下面是一些示例代码:

private void gridView_ShownEditor(object sender, EventArgs e) { 
    GridView view = (GridView)sender; 
    if (view.FocusedColumn != employee_id) return; 
    ComboBoxEdit editor = (ComboBoxEdit)view.ActiveEditor;  
    // Here bind the editor DataSource and ValueMember and 
     Display member to employee_id 
} 

其他方式: 编号:How to bind dataset with different values to repository combobox in runtime

RepositoryItemComboBox combo = new RepositoryItemComboBox(); 
      combo.Items.AddRange(new string[{values}); 
      gridControl1.RepositoryItems.Add(combo); 
      gridView1.Columns["Criteria"].ColumnEdit = combo; 

编号:
How to populate the RepositoryItemCheckedComboBox with item based on the selection made in another cell
combobox in gridcontrol
Column Value List

+0

非常感谢!谢谢! – giang