I
IceHiker
Guest
This should be simple, but Im having some problems figuring it out. My case differs somewhat from the other postings where people are trying to add Blank Items to a ComboBox list. In my case, I have a real Data Row and a valid DisplayMember/ValueMember pair where the Display Members value is "" (a string value with no characters in it).
The problem is that the DataGridViewComboBoxColumn DropDownButton will allow the user to properly select the Blank Item, but then the DropDownButton automagically changes the selected item and its binding sources position to either the previously selected non-blank value or the first non-blank value if no previous selection was made.
The work around I am currently using is to replace the "" with a " " (i.e. a single space character string). Since everything works OK after replacing the empty string value with a non-empty string value, it makes me believe that the issue is the DataGridViewComboBoxColumn DropDownButton implementation, and not some obscure bug in my code. The workaround is also essentially transparent to the user. However, I really would like the user to be able to select the first item in a dropdown list if that items value is "" - instead of creating a special case workaround.
Anyone know the DataGridViewComboBoxColumn DropDownButton or ComboBox property that allows a valid item with a "" value to be selectable?
//aj
Revised: Using DataGridViewComboBoxColumn.DisplayStyle = DropDownButton
Continue reading...
The problem is that the DataGridViewComboBoxColumn DropDownButton will allow the user to properly select the Blank Item, but then the DropDownButton automagically changes the selected item and its binding sources position to either the previously selected non-blank value or the first non-blank value if no previous selection was made.
The work around I am currently using is to replace the "" with a " " (i.e. a single space character string). Since everything works OK after replacing the empty string value with a non-empty string value, it makes me believe that the issue is the DataGridViewComboBoxColumn DropDownButton implementation, and not some obscure bug in my code. The workaround is also essentially transparent to the user. However, I really would like the user to be able to select the first item in a dropdown list if that items value is "" - instead of creating a special case workaround.
Anyone know the DataGridViewComboBoxColumn DropDownButton or ComboBox property that allows a valid item with a "" value to be selectable?
//aj
Revised: Using DataGridViewComboBoxColumn.DisplayStyle = DropDownButton
Continue reading...