Hello, I have a data grid with a GridViewComboBoxColumn bound to an field which is an enumeration. I use DataSource and properties 'ValueMember' and 'DisplayMember' to map enum values to readable strings. When I try to set a filter on the column an exception ist thrown 'column <x> not found' ( where x is the string represantation of the enum value )
Here is an example: If I then try to set filter to EProductType.Hard => EvaluateExcetion is thrown 'column [Hard] not found'
First FilterConditionType is 'NoFilter', when I select condition exception occurs
Tried with current version 2010 Q1 SP 1
Is there a workaround ?
Regards,
Markus
Here is an example: If I then try to set filter to EProductType.Hard => EvaluateExcetion is thrown 'column [Hard] not found'
First FilterConditionType is 'NoFilter', when I select condition exception occurs
| public enum EProductType |
| { |
| None = 0, |
| Soft = 1, |
| Hard = 2 |
| } |
| class Product |
| { |
| EProductType _productType; |
| public EProductType ProductType |
| { |
| get { return _productType; } |
| set { _productType = value; } |
| } |
| string _key; |
| public string Key |
| { |
| get { return _key; } |
| set { _key = value; } |
| } |
| string _name; |
| public string Name |
| { |
| get { return _name; } |
| set { _name = value; } |
| } |
| } |
| private void AddMapping() |
| { |
| IList<ValueMapping> mappings = new List<ValueMapping>(); |
| mappings.Add(new ValueMapping(EProductType.None, "")); |
| mappings.Add(new ValueMapping(EProductType.Hard, "Hardware")); |
| mappings.Add(new ValueMapping(EProductType.Soft, "Software")); |
| Telerik.WinControls.UI.GridViewComboBoxColumn comboColumn = radGridView1.Columns[0] as Telerik.WinControls.UI.GridViewComboBoxColumn; |
| comboColumn.DataSource = mappings; |
| comboColumn.ValueMember = "ValueMember"; |
| comboColumn.DisplayMember = "DisplayMember"; |
| } |
| class ValueMapping |
| { |
| public ValueMapping(object value, string displayMember) |
| { |
| _valueMember = value; |
| _displayMember = displayMember; |
| } |
| string _displayMember; |
| public string DisplayMember |
| { |
| get { return _displayMember; } |
| } |
| object _valueMember; |
| public object ValueMember |
| { |
| get { return _valueMember; } |
| } |
| } |
Tried with current version 2010 Q1 SP 1
Is there a workaround ?
Regards,
Markus