0

I am trying to create a datagridComboBoxcolumn in winforms with Suggestions Based on Loose Character Search similar to Easycomplete combobox. but I want this as Datagridview combobox.

I have created a grid with Datagridviewcombobox column and used autocomplete but it will search only from first characters. I want loose search. I used

 private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (e.Control is DataGridViewComboBoxEditingControl)
            {
                ((ComboBox)e.Control).DropDownStyle = ComboBoxStyle.DropDown;
                ((ComboBox)e.Control).AutoCompleteSource = AutoCompleteSource.ListItems;
                ((ComboBox)e.Control).AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            } 
}

Please provide me a solution to create this type of datagridviewcombobox.

xamarin cool
  • 83
  • 1
  • 9

1 Answers1

0

For that you have to create a custom DataGridiVew control. This is not a one line code or not a single class code. you have to make several classes for that.

public class MyDgv : DataGridView
{
    ....    
}

And also create some classes like DataGridViewComboBoxColumn, DataGridViewComboBoxCell, DataGridViewEditingComboBoxControl

There is a tutorial how to create custom column in datagridview on msdn

Shell
  • 6,818
  • 11
  • 39
  • 70