Click here to Skip to main content
15,895,667 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Currency Converter(Silverlight+MVVM) Pin
Ipsita_2325-Aug-13 1:09
Ipsita_2325-Aug-13 1:09 
QuestionControl's Border Color animation Pin
thecco23-Aug-13 7:08
thecco23-Aug-13 7:08 
AnswerRe: Control's Border Color animation Pin
koll Zhu22-Sep-13 23:49
koll Zhu22-Sep-13 23:49 
Questionhow to show data in combobox from database in silverlight Pin
Member 793334323-Aug-13 1:22
Member 793334323-Aug-13 1:22 
AnswerRe: how to show data in combobox from database in silverlight Pin
Richard MacCutchan23-Aug-13 2:56
mveRichard MacCutchan23-Aug-13 2:56 
AnswerRe: how to show data in combobox from database in silverlight Pin
Brian Holsen25-Aug-13 18:22
Brian Holsen25-Aug-13 18:22 
AnswerRe: how to show data in combobox from database in silverlight Pin
koll Zhu22-Sep-13 23:49
koll Zhu22-Sep-13 23:49 
QuestionWPF DataGrid ComboBox Column Binding Problem Pin
Kevin Marois22-Aug-13 5:13
professionalKevin Marois22-Aug-13 5:13 
I have a combobox column in a DataGrid.

I want the combo column's data source to be a list of LookupEntity called JobPhaseTypes on the VM:

public class LookupEntity
{
    public int Id { get; set; }
    public string Caption { get; set; }
}


The grid itself is bound to a list of JobPhase objects:

   public class JobPhaseEntity : _BaseEntity
    {
        public int JobRevisionId { get; set; }

        public string PhaseName { get; set; }

        public LookupEntity JobPhaseType { get; set; }

        public DateTime StartDateTime { get; set; }

        public DateTime EndDateTime { get; set; }
    }
}


So far I have this:

<DataGridComboBoxColumn Header="Phase Type"
                        SelectedItemBinding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.SelectedJobPhaseType}"
                        DisplayMemberPath="Caption"
                        Width="150">

    <DataGridComboBoxColumn.EditingElementStyle>
        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.JobPhaseTypes}"/>
            <Setter Property="IsReadOnly" Value="True"/>
            <Setter Property="StaysOpenOnEdit" Value="True" />
        </Style>
    </DataGridComboBoxColumn.EditingElementStyle>

    <DataGridComboBoxColumn.ElementStyle>
        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.JobPhaseTypes}"/>
        </Style>
    </DataGridComboBoxColumn.ElementStyle>

</DataGridComboBoxColumn>


When I change the combo's value on any row, it changes on all rows.

What am I doing wrong here?

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

QuestionWPF - Understanding Binding Syntax Pin
Kevin Marois20-Aug-13 8:29
professionalKevin Marois20-Aug-13 8:29 
AnswerRe: WPF - Understanding Binding Syntax Pin
Mycroft Holmes20-Aug-13 12:52
professionalMycroft Holmes20-Aug-13 12:52 
GeneralRe: WPF - Understanding Binding Syntax Pin
Kevin Marois20-Aug-13 15:05
professionalKevin Marois20-Aug-13 15:05 
GeneralRe: WPF - Understanding Binding Syntax Pin
Mycroft Holmes20-Aug-13 15:37
professionalMycroft Holmes20-Aug-13 15:37 
GeneralRe: WPF - Understanding Binding Syntax Pin
Kevin Marois20-Aug-13 17:15
professionalKevin Marois20-Aug-13 17:15 
SuggestionRe: WPF - Understanding Binding Syntax Pin
Richard MacCutchan20-Aug-13 20:17
mveRichard MacCutchan20-Aug-13 20:17 
GeneralRe: WPF - Understanding Binding Syntax Pin
Kevin Marois21-Aug-13 5:23
professionalKevin Marois21-Aug-13 5:23 
QuestionWPF/MVVM DataGrid Set Focus to Cell in Edit Mode Pin
Kevin Marois20-Aug-13 7:46
professionalKevin Marois20-Aug-13 7:46 
AnswerRe: WPF/MVVM DataGrid Set Focus to Cell in Edit Mode Pin
Mycroft Holmes20-Aug-13 12:46
professionalMycroft Holmes20-Aug-13 12:46 
QuestionMaximize and Restore Buttons Pin
MohammedRuman19-Aug-13 22:10
MohammedRuman19-Aug-13 22:10 
AnswerRe: Maximize and Restore Buttons Pin
Jason Gleim27-Aug-13 5:45
professionalJason Gleim27-Aug-13 5:45 
QuestionSliding Panel in Wpf Pin
MohammedRuman19-Aug-13 22:05
MohammedRuman19-Aug-13 22:05 
AnswerRe: Sliding Panel in Wpf Pin
Mycroft Holmes19-Aug-13 22:32
professionalMycroft Holmes19-Aug-13 22:32 
AnswerRe: Sliding Panel in Wpf Pin
Jason Gleim27-Aug-13 5:49
professionalJason Gleim27-Aug-13 5:49 
QuestionSilverlight and Android Application Interaction Pin
SwapnilSinnar18-Aug-13 1:39
SwapnilSinnar18-Aug-13 1:39 
AnswerRe: Silverlight and Android Application Interaction Pin
Mycroft Holmes18-Aug-13 11:50
professionalMycroft Holmes18-Aug-13 11:50 
AnswerRe: Silverlight and Android Application Interaction Pin
Jason Gleim27-Aug-13 5:54
professionalJason Gleim27-Aug-13 5:54 

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.