2012-05-20 138 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