//ComboBox column
this.gridGroupingControl1.TableDescriptor.Columns["Country"].FilterRowOptions.FilterMode = FilterMode.DisplayText;
//Or
foreach (var column in gridGroupingControlVehicle.TableDescriptor.Columns)
{
column.FilterRowOptions.FilterMode = FilterMode.DisplayText;
column.AllowFilter = true;
} |
this.gridGroupingControl1.TableControl.CurrentCellShowingDropDown += TableControl_CurrentCellShowingDropDown;
private void TableControl_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell currentCell = this.gridGroupingControl1.TableControl.CurrentCell;
GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(currentCell.RowIndex, currentCell.ColIndex);
GridComboBoxCellRenderer renderer = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer;
if (renderer != null)
{
var list = renderer.ListBoxPart.Items.Cast<DataRowView>().OrderBy(x => x.Row[1]).ToList();
renderer.ListBoxPart.DataSource = null;
if (style.HasDisplayMember)
{
renderer.ListBoxPart.DisplayMember = style.DisplayMember;
renderer.ListBoxPart.ValueMember = style.ValueMember;
}
renderer.ListBoxPart.DataSource = list;
}
} |