rad grid column wpf telerik enum
// Step 1 (Enum)
public enum Position
{
[Display(Name = "Goalkeeper", ShortName = "Goalie")]
[Description("The player responsible for protecting his team's goal.")]
GK = 0,
DF = 1,
MF = 2,
FW = 3
}
// Step 2 (ViewModel)
IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> positions;
public IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> Positions
{
get
{
if (positions == null)
{
positions = Telerik.Windows.Data.EnumDataSource.FromType<Position>();
}
return positions;
}
}
// Step 3 (XAML)
<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding Position}"
ItemsSource="{Binding Positions, Source={StaticResource MyViewModel}}"
DisplayMemberPath="DisplayName"
SelectedValueMemberPath="Value" />