This is a migrated thread and some comments may be shown as answers.

How to set GroupMemberPath for column with enums

3 Answers 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 20 Sep 2011, 04:39 PM
I have a column with enum as itemssource:

<telerik:GridViewComboBoxColumn Header="Type" DataMemberBinding="{Binding VehicleCondition}" ItemsSourceBinding="{Binding Source={StaticResource Locator}, Path=ShowroomLog.VehicleConditions}" />

And I'm getting this datasource from viewmodel

public IEnumerable<VehicleConditions> VehicleConditions
        {
            get
            {
                Type enumType = typeof(VehicleConditions);
 
                FieldInfo[] infos = enumType.GetFields(BindingFlags.Public | BindingFlags.Static);
 
                return infos.Select(fieldInfo => (VehicleConditions)Enum.Parse(enumType, fieldInfo.Name, true)).ToList();
 
            }
 
        }

Best regards

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 21 Sep 2011, 08:29 AM
Hello John,

This should be as for any other column. Doesn't GroupMemberPath = "VehicleCondition"  do the trick?. Or maybe I am not getting the question right ? What is the desired behavior you are trying to achieve ?

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
John
Top achievements
Rank 1
answered on 21 Sep 2011, 09:21 AM
Hello Pavel, 

Unfortunately it doesn't work. 

Then I have the effect like in attachment
0
Pavel Pavlov
Telerik team
answered on 26 Sep 2011, 02:29 PM
Hello John,

It seems I am missing something. I have performed a test. Please see the project attached.
I have set the GroupMemberPath to a column displaying enums .

Everything seems t work great. Can you please check the attached example and let me know what are the differences compared to your implementation.

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
John
Top achievements
Rank 1
Share this question
or