Hello,
Thank you for writing.
The GridViewComboBoxColumn.
FilterMode property has two values and determines whether the column will be filtered according to the
DisplayMember or the
ValueMember. As to the autocomplete functionality you can search the entered text to be contained in the item's text, not the item's text to start with the entered pattern. For this purpose it is necessary to handle the
CellEditorInitialized event as follows:
private
void
RadForm1_Load(
object
sender, EventArgs e)
{
this
.productsTableAdapter.Fill(
this
.nwindDataSet.Products);
this
.categoriesTableAdapter.Fill(
this
.nwindDataSet.Categories);
this
.radGridView1.DataSource =
this
.productsBindingSource;
GridViewComboBoxColumn customerColumn =
new
GridViewComboBoxColumn(
"Categories"
);
customerColumn.DataSource =
this
.categoriesBindingSource;
customerColumn.ValueMember =
"CategoryID"
;
customerColumn.DisplayMember =
"CategoryName"
;
customerColumn.FieldName =
"CategoryID"
;
this
.radGridView1.Columns.Add(customerColumn);
this
.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
}
private
void
radGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
RadDropDownListEditor editor = e.ActiveEditor
as
RadDropDownListEditor;
if
(editor !=
null
)
{
RadDropDownListEditorElement el = editor.EditorElement
as
RadDropDownListEditorElement;
el.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
el.AutoCompleteMode = AutoCompleteMode.Suggest;
el.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
}
}
Off topic, if you have any further questions, I would kindly ask you to submit a support ticket where the Telerik support will gladly assist you.
I hope this information helps.
Regards,
Dess
Progress Telerik