//GridControl setting to make like a combobox
this.gridControl1.RowCount = 1;
this.gridControl1.ColCount = 1;
this.gridControl1.ShowRowHeaders = false;
this.gridControl1.ShowColumnHeaders = false;
this.gridControl1.DefaultRowHeight = 20;
this.gridControl1[1, 1].CellType = GridCellTypeName.DropDownGrid;
GridCellRendererBase renderer = this.gridControl1.CellRenderers["DropDownGrid"];
if (renderer is GridDropDownGridCellRenderer)
{
GridDropDownGridCellRenderer dropdown = renderer asGridDropDownGridCellRenderer;
gridGrouping = new GridGroupingControl();
GridSettings();
gridGrouping.TableControl.DropDownContainerParent = dropdown.DropDownContainer;
//Add the GridGroupingControl in drop down container
dropdown.DropDownContainer.Controls.Add(gridGrouping);
}
//Enable the filtering support
gridGrouping.TopLevelGroupOptions.ShowFilterBar = true;
foreach (GridColumnDescriptor column in this.gridGrouping.TableDescriptor.Columns)
{
column.AllowFilter = true;
} |
Hello, I try the solution, but i have some questions, how i have de value from de record selected ?
//Record record = this.gridGrouping.Table.CurrentRecord;
//OR
//To get the selected records
Record record = gridGrouping.Table.SelectedRecords[0].Record;
if (record != null)
{
//To get the value of selected record
string value = record.GetValue("Name").ToString();
} |