我在 SyncFusion:GridControl 中动态添加了一个 SyncFusion ComboBox,代码如下:
SchoolGrid.Model[rowIndex, columnIndex].CellType = "ComboBox";
SchoolGrid.Model[rowIndex, columnIndex].ItemsSource = itemSource;
SchoolGrid.Model[rowIndex, columnIndex].DisplayMember = "FullDistrictName";
SchoolGrid.Model[rowIndex, columnIndex].ValueMember = "FullDistrictName";
SchoolGrid.Model[rowIndex, columnIndex].CellValue = cellValue;
SchoolGrid.Model[rowIndex, columnIndex].DropDownStyle = GridDropDownStyle.Exclusive;
我想要实现的是:
1)组合框中的项目我想以“古吉拉特/苏拉特”格式显示。当用户选择任何项目时,我想要显示的值只是“Surat”,而不是“Gujarat/Surat”。
2)当用户打开下拉列表时,选定的项目应该有焦点。
在 QueryCellInfo 事件中,我已将此列的值指定为模型的“区域”属性。在 CommitCellInfo 事件中,我正在获取值并将其分配给模型属性。所以第 1 点)按要求工作。但我无法使第 2 点)工作。我试过使用 OnCurrentCellShowingDropDown、GotFocus 事件,但没有运气。我怎样才能让它工作?