Click here to Skip to main content
14,974,357 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA8-Feb-17 22:10
MemberMrKBA8-Feb-17 22:10 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming8-Feb-17 22:16
mveRichard Deeming8-Feb-17 22:16 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA8-Feb-17 23:47
MemberMrKBA8-Feb-17 23:47 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
Richard Deeming9-Feb-17 0:00
mveRichard Deeming9-Feb-17 0:00 
GeneralRe: still shown DialogService until error exists in user input and dont press Cancel Pin
MrKBA9-Feb-17 1:41
MemberMrKBA9-Feb-17 1:41 
QuestionWPF: DataGridCheckboxColumn when one checkbox is checked, check another checkbox in same row Pin
Mark McArdle6-Feb-17 3:04
MemberMark McArdle6-Feb-17 3:04 
AnswerRe: WPF: DataGridCheckboxColumn when one checkbox is checked, check another checkbox in same row Pin
Richard Deeming6-Feb-17 7:55
mveRichard Deeming6-Feb-17 7:55 
PraiseRe: WPF: DataGridCheckboxColumn when one checkbox is checked, check another checkbox in same row Pin
Mark McArdle7-Feb-17 2:07
MemberMark McArdle7-Feb-17 2:07 
QuestionStyle User Control In Another Assembly Pin
Kevin Marois2-Feb-17 6:54
professionalKevin Marois2-Feb-17 6:54 
AnswerRe: Style User Control In Another Assembly Pin
Pete O'Hanlon2-Feb-17 7:12
mvePete O'Hanlon2-Feb-17 7:12 
GeneralRe: Style User Control In Another Assembly Pin
Kevin Marois2-Feb-17 7:13
professionalKevin Marois2-Feb-17 7:13 
GeneralRe: Style User Control In Another Assembly Pin
Kevin Marois2-Feb-17 7:50
professionalKevin Marois2-Feb-17 7:50 
QuestionTelerik GridViewComboBoxColumn Pin
eddieangel25-Jan-17 12:29
Membereddieangel25-Jan-17 12:29 
AnswerRe: Telerik GridViewComboBoxColumn Pin
Graeme_Grant28-Jan-17 2:23
professionalGraeme_Grant28-Jan-17 2:23 
QuestionDataGrid DataGridComboBoxColumn Enum Descriptions Pin
Kevin Marois24-Jan-17 6:22
professionalKevin Marois24-Jan-17 6:22 
AnswerRe: DataGrid DataGridComboBoxColumn Enum Descriptions Pin
Afzaal Ahmad Zeeshan24-Jan-17 6:46
mveAfzaal Ahmad Zeeshan24-Jan-17 6:46 
QuestionWPF DataGrid Extended Pin
Kevin Marois23-Jan-17 10:00
professionalKevin Marois23-Jan-17 10:00 
AnswerRe: WPF DataGrid Extended Pin
Richard Deeming23-Jan-17 10:25
mveRichard Deeming23-Jan-17 10:25 
GeneralRe: WPF DataGrid Extended Pin
Kevin Marois23-Jan-17 10:28
professionalKevin Marois23-Jan-17 10:28 
QuestionComboBox Restore Saved Item Pin
Kevin Marois20-Jan-17 10:06
professionalKevin Marois20-Jan-17 10:06 
AnswerRe: ComboBox Restore Saved Item Pin
Afzaal Ahmad Zeeshan20-Jan-17 11:20
mveAfzaal Ahmad Zeeshan20-Jan-17 11:20 
AnswerRe: ComboBox Restore Saved Item Pin
Mycroft Holmes20-Jan-17 11:54
professionalMycroft Holmes20-Jan-17 11:54 
GeneralRe: ComboBox Restore Saved Item Pin
Kevin Marois20-Jan-17 11:58
professionalKevin Marois20-Jan-17 11:58 
GeneralRe: ComboBox Restore Saved Item Pin
Mycroft Holmes20-Jan-17 14:14
professionalMycroft Holmes20-Jan-17 14:14 
QuestionEnumDescriptionConverter Exception Pin
Kevin Marois20-Jan-17 9:55
professionalKevin Marois20-Jan-17 9:55 
My enum:
public enum AccessLevel
{
    [Description("No Acccess")]
    NoAccess = 0,

    [Description("Full Acccess")]
    HasAccess = 1
}
My Right entity
public class RightEntity : _EntityBase
{
    private string _RightName = string.Empty;
    public string RightName
    {
        get { return _RightName; }
        set
        {
            if (_RightName != value)
            {
                _RightName = value;
                RaisePropertyChanged("RightName");
            }
        }
    }

    private AccessLevel _Access = AccessLevel.NoAccess;
    public AccessLevel Access
    {
        get { return _Access; }
        set
        {
            if (_Access != value)
            {
                _Access = value;
                RaisePropertyChanged("Access");
            }
        }
    }
}
The view
<Window.Resources>
    <wpfconv:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
    <ObjectDataProvider MethodName="GetValues" 
                        ObjectType="{x:Type sys:Enum}"
                        x:Key="accessEnums">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="enums:AccessLevel" />
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
</Window.Resources>
and
<ComboBox Grid.Row="7"
            Grid.Column="0"
            ItemsSource="{Binding Source={StaticResource accessEnums}}"
            SelectedItem="{Binding SelectedRight.Access}"
            IsEnabled="{Binding RightsFieldsEnabled}"
            Width="125"
            HorizontalAlignment="Left"
            Style="{StaticResource comboBoxStyle}"
            Margin="2">

<pre>
<ComboBox.ItemTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}"
                    FontSize="14"/>
    </DataTemplate>
</ComboBox.ItemTemplate>



Problem: When I load the combo list the enum descriptions show fine. I then edit a record and save, then reload the list. I then get an exception in the converter in the Convert method:
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
    Enum myEnum = (Enum)value;         // <========= EXCEPTION HERE - 'value' is an empty string.
    string description = GetEnumDescription(myEnum);
    return description;
}

Not really sure what's happening. Am I doing this right? Anyone see what's wrong?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.