devExpress.XtraGrid.GridControl winform和c#中的两个链接lookupEdit

时间:2018-02-08 11:54:20

标签: c# winforms devexpress

我有问题。例如;

gridControl at 3.columns 5.cells in lookUpEdit datasource binding 或动态1.columns 5.cells,2.columns 5.cells ... in lookUpEdit datasource binding。

  • datasource:firebird或sqlServer(dataset)
  • 组件:devExpress gridControl gridView

提前致谢...

2 个答案:

答案 0 :(得分:1)

我相信,您应该使用How to filter a second LookUp column based on a first LookUp column's value)知识库文章中展示的方法:

void gridView1_ShownEditor(object sender, EventArgs e) {
    ColumnView view = (ColumnView)sender;
    if (view.FocusedColumn.FieldName == "CityCode" && view.ActiveEditor is LookUpEdit) {
        LookUpEdit edit = (LookUpEdit)view.ActiveEditor;
        string countryCode = (string)view.GetFocusedRowCellValue("CountryCode");
        edit.Properties.DataSource = GetFilteredCities(countryCode);
    }
}

请参阅How to filter a second LookUp column based on a first LookUp column's value示例,其中显示了此方法。

答案 1 :(得分:-1)

enter image description here

我想将数据源分配给以黄色标记的单元格(RepositoryItemLookUpEdit)