Hi Coen,
I performed a test on this issue and found that this problem exists when I
bind the DataGridViewComboBoxColumn to a DataTable, i.e. set the
DataGridViewComboBoxColumn's DataSource property to the DataTable and its
DisplayMember property to a column and its ValueMember property to another
column in the DataTable.
The DataTable has two columns: col1 and col2. There're 6 rows in the
DataTable as follows:
1 Red
2 red
3 Green
4 green
5 Black
6 black
Run the program and select 'green' from the drop down list of a
DataGridViewComboBoxCell. After the focus leaves the cell, the text in the
cell becomes 'Green'. It seems that the underlying data source, i.e. the
DataTable regards 'Green' to be equal to 'green'. After I set the
DataTable's CaseSensitive property to true as Clay suggests, the problem
disappears.
FYI, this problem doesn't exist if we add items to the
DataGridViewComboBoxColumn directly. For example,
this.Column1.Items.Add("Red");
this.Column1.Items.Add("red");
this.Column1.Items.Add("Green");
this.Column1.Items.Add("green");
This problem doesn't exist either on ComboBox, even if the DataTable's
CaseSensitive property is the default value--false.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.