1

I am using

DataGridViewComboBoxCell 

in my application and displaying some values . Suppose there are 3 values as follows :

admin    ABC   and  Xyz

First display item is admin My cell style is as :

comboControl.DropDownStyle = ComboBoxStyle.DropDown;

So user can edit the items after selecting it. My problem arises when user is editing item with the same name but with different case. As in detail, If he selected admin and he wants to change it to

ADMIN or aDmin or any other , then its value again becoming admin(as previous).

However , I am surprise to see that if user is writing any other text like

adminbbjds or hello or any thing , Its value get changed.

If you have any solution then please give me one!

This problem not arises when user is pressing enter after editing but arises when user click on any other point then its value becoming change.

I am using ,

this.gViewMainGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.gViewMainGridView_EditingControlShowing);
private void gViewMainGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
         DataGridViewComboBoxCell cell = gViewMainGridView.CurrentCell as DataGridViewComboBoxCell;
              DataGridViewComboBoxEditingControl comboControl = e.Control as DataGridViewComboBoxEditingControl;
             //comboControl.DropDownStyle = (DataGridViewComboBoxColumn)DataGridViewComboBoxDisplayStyle.ComboBox;
             if (comboControl != null)
             {
                comboControl.DropDownStyle = ComboBoxStyle.DropDown;         
             }
    }
  • [Click](http://www.codeproject.com/Articles/1363/Case-sensitive-ComboBox). – Sinatr Jun 16 '15 at 13:39
  • 1
    Can you post all __relevant__ code, ie the `CellValidating`, the `EditingControlShowing` and other possibly relevant events that you have coded..? – TaW Jun 16 '15 at 15:40
  • Actually i have taken a DataGridView in which there are few columns added in design mode , In these column one ColumnType is DataGridViewComboBoxColumn. There are some items already added in this ComboBoxColumn . I think i have posted enough code , if any help then please provide. –  Jun 17 '15 at 05:24
  • @TaW , I have given some more code as per your demand . –  Jun 17 '15 at 06:46

0 Answers0