This question is locked. New answers and comments are not allowed.
I want a RadGridView which simply has a collection of enums as its ItemsSource. I have defined the grid as:
| <gridView:RadGridView x:Name="AssignedPermissionsGrid" AutoGenerateColumns="False" ShowInsertRow="False" ItemsSource="{Binding AssignedPermissions}"> |
| <gridView:RadGridView.Columns> |
| <gridView:GridViewDataColumn Header="Assigned Permissions" /> |
| </gridView:RadGridView.Columns> |
| </gridView:RadGridView> |
In my code behind I have setup the DataContext of my UserControl to be my ViewModel, and then my ViewModel has a property named AssignedPermissions:
| public ICollection<Permissions> AssignedPermissions |
| { |
| get |
| { |
| return _assignedPermissions; |
| } |
| set |
| { |
| if (value != _assignedPermissions) |
| { |
| _assignedPermissions = value; |
| RaisePropertyChanged("AssignedPermissions"); |
| } |
| } |
| } |
Permissions is an enum with the [Flags] attribute.
This all works just fine, except the rows in the grid are empty. So if AssignedPermissions contains 5 elements, then I get five rows in the grid, but each row is blank.
How can I have the value in each row be equal to calling ToString() on the enum value? Or better yet, if I apply System.ComponentModel.DescriptionAttribute to each entry in the enum, how can I get that DescriptionAttribute value be displayed in the grid?
If I bind the grid to an ICollection<int> it displays the int values just fine.
I am using Silverlight 4, .NET 4, and my Telerik.Windows.Controls.GridView assembly is version 2010.1.422.1040
Thanks,