Home Forums WinForms controls Xceed Grid for WinForms WinComboBox as Editor/Viewer Reply To: WinComboBox as Editor/Viewer

User (Old forums)
Member
Post count: 23064

This forum is cool, I often find the answer to my problem right after I post ;o)
I seem to have misunderstood how you implement the interfaces. Obviously you have to make the get/set methods return/set the same type that is defined by the cell.

Here’s my new implementation that works fine:
void ICellEditor.SetControlValue(object value, IFormatProvider customFormatProvider)
{
for (int i = 0; i < this.Items.Count; i++)
{
if (this.Items[i].Values[0].ToString() == (string)Convert.ChangeType(value, typeof(string), customFormatProvider))
{
this.SelectedItem = this.Items[i];
return;
}
}
}

Imported from legacy forums. Posted by macke (had 2862 views)