Click here to Skip to main content
15,887,485 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Where to go to learn wpf? Pin
Mycroft Holmes5-Jan-15 13:21
professionalMycroft Holmes5-Jan-15 13:21 
AnswerRe: Where to go to learn wpf? Pin
Richard MacCutchan5-Jan-15 22:43
mveRichard MacCutchan5-Jan-15 22:43 
AnswerRe: Where to go to learn wpf? Pin
Vimalsoft(Pty) Ltd12-Jan-15 20:56
professionalVimalsoft(Pty) Ltd12-Jan-15 20:56 
AnswerRe: Where to go to learn wpf? Pin
Subramanyam Shankar17-Mar-15 1:04
professionalSubramanyam Shankar17-Mar-15 1:04 
QuestionMultithreaded Windows with Data Binding Pin
Dominick Marciano5-Jan-15 8:30
professionalDominick Marciano5-Jan-15 8:30 
AnswerRe: Multithreaded Windows with Data Binding Pin
Afzaal Ahmad Zeeshan9-Jan-15 8:41
professionalAfzaal Ahmad Zeeshan9-Jan-15 8:41 
AnswerRe: Multithreaded Windows with Data Binding Pin
SledgeHammer0111-Jan-15 8:37
SledgeHammer0111-Jan-15 8:37 
QuestionWPF DataGrid with ComBox Bound To Enums - Show Descriptions Pin
Kevin Marois5-Jan-15 7:03
professionalKevin Marois5-Jan-15 7:03 
I have this enum:

public enum MyEnum
{
    [Description("This is enum A")]
    EnumA,

    [Description("This is enum B")]
    EnumB,

    [Description("This is enum C")]
    EnumC,
}
}


I bound it to a datagrid like this:

<Window.Resources>
    <ResourceDictionary>

        <ObjectDataProvider x:Key="projectTypeList" 
                            MethodName="GetValues" 
                            ObjectType="{x:Type enums:MyEnum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="enums:MyEnum"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

    </ResourceDictionary>

</Window.Resources>


and then
<DataGrid Grid.Row="1">

    <DataGrid.Columns>


        <DataGridComboBoxColumn Header="Project Type"
                                ItemsSource="{Binding Source={StaticResource projectTypeList}}"
                                Width="150"/>


    </DataGrid.Columns>

</DataGrid>


I can see the enum values in the combo. What I'd really like is to show the descriptions. Can someone show me how to do this?

Many thanks!
If it's not broken, fix it until it is

AnswerRe: WPF DataGrid with ComBox Bound To Enums - Show Descriptions Pin
Pete O'Hanlon5-Jan-15 7:19
mvePete O'Hanlon5-Jan-15 7:19 
QuestionGetting error when i drag&drop in WPF Pin
VisualLive1-Jan-15 17:35
VisualLive1-Jan-15 17:35 
AnswerRe: Getting error when i drag&drop in WPF Pin
Afzaal Ahmad Zeeshan9-Jan-15 8:44
professionalAfzaal Ahmad Zeeshan9-Jan-15 8:44 
AnswerRe: Getting error when i drag&drop in WPF Pin
Vimalsoft(Pty) Ltd11-Jan-15 23:52
professionalVimalsoft(Pty) Ltd11-Jan-15 23:52 
QuestionLoop in Dispatch.Invoke Not Updating UI Pin
Dominick Marciano31-Dec-14 16:15
professionalDominick Marciano31-Dec-14 16:15 
QuestionSelectionChanged Event is not firing on View Load in MVVM Pin
Ashfaque Hussain29-Dec-14 20:15
Ashfaque Hussain29-Dec-14 20:15 
QuestionSilverlight? A future? Pin
Sean McPoland26-Dec-14 23:46
Sean McPoland26-Dec-14 23:46 
AnswerRe: Silverlight? A future? Pin
Richard MacCutchan26-Dec-14 23:57
mveRichard MacCutchan26-Dec-14 23:57 
AnswerRe: Silverlight? A future? Pin
Pete O'Hanlon27-Dec-14 2:03
mvePete O'Hanlon27-Dec-14 2:03 
QuestionWhat are those automation peer in WPF? Pin
Super Lloyd22-Dec-14 0:55
Super Lloyd22-Dec-14 0:55 
AnswerRe: What are those automation peer in WPF? Pin
Pete O'Hanlon22-Dec-14 1:32
mvePete O'Hanlon22-Dec-14 1:32 
AnswerRe: What are those automation peer in WPF? Pin
syed shanu23-Dec-14 17:42
mvasyed shanu23-Dec-14 17:42 
QuestionRouted Event No Responding Pin
Kevin Marois18-Dec-14 9:20
professionalKevin Marois18-Dec-14 9:20 
QuestionBest way to stroke a path with TWO colors? Pin
SledgeHammer0117-Dec-14 11:17
SledgeHammer0117-Dec-14 11:17 
SuggestionRe: Best way to stroke a path with TWO colors? Pin
Matt T Heffron17-Dec-14 11:39
professionalMatt T Heffron17-Dec-14 11:39 
GeneralRe: Best way to stroke a path with TWO colors? Pin
SledgeHammer0117-Dec-14 12:06
SledgeHammer0117-Dec-14 12:06 
QuestionWPF DataGrid Date Format Pin
Kevin Marois17-Dec-14 7:21
professionalKevin Marois17-Dec-14 7:21 

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.