Click here to Skip to main content
15,867,287 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF Combobox databinding Pin
ABitSmart5-Mar-09 4:07
ABitSmart5-Mar-09 4:07 
GeneralRe: WPF Combobox databinding Pin
babongita5-Mar-09 5:20
babongita5-Mar-09 5:20 
GeneralRe: WPF Combobox databinding Pin
ABitSmart5-Mar-09 5:23
ABitSmart5-Mar-09 5:23 
GeneralRe: WPF Combobox databinding Pin
babongita5-Mar-09 5:40
babongita5-Mar-09 5:40 
GeneralRe: WPF Combobox databinding Pin
ABitSmart5-Mar-09 5:57
ABitSmart5-Mar-09 5:57 
GeneralRe: WPF Combobox databinding Pin
babongita5-Mar-09 6:11
babongita5-Mar-09 6:11 
GeneralRe: WPF Combobox databinding Pin
ABitSmart5-Mar-09 16:47
ABitSmart5-Mar-09 16:47 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 2:26
babongita6-Mar-09 2:26 
The ParameterViewModel has an ObservableCollection ParameterNameCollection which is a collection of possible names that it could be, with attributes associated to that name, so the Collection is what fills the combobox, but I want the SelectedItem to be the ParameterName of the Parameter object.

If I was to post the complete class for the ParameterViewModel it would look like this:
ParameterViewModel
has a ControlModeCollection (ObservableCollection)
has a ControlTypeCollection (ObservableCollection)
has a DataTypeCollection (ObservableCollection)
has a ParameterMethodCollection (ObservableCollection)
has a ParameterNameCollection (ObservableCollection)
has a DP of SelectedParameter (of Type Parameter)
has a DP of SelectedParameterDefaults (I think this is redundant since it is an ObservableCollection)

Then the Parameter class looks like the following
has a Name (of Type ParameterName)
has a DataType (of Type DataType)
has a ScreenLabel (of Type String)
etc. etc.

the TextBox XAML works as expected, the ComboBox doesn't

<TextBox x:Name="txtParameterLabel"
Style="{DynamicResource RoundedCornerTextBox}"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="6"
Text="{Binding SelectedParameter.ScreenLabel}"
TabIndex="40"/>

<ComboBox x:Name="cboParameterName"
VerticalAlignment="Center"
IsSynchronizedWithCurrentItem="True"
TabIndex="10"
Grid.Column="1"
Grid.ColumnSpan="4"
ItemsSource="{Binding Path=ParameterNameCollection}"
SelectedValue="{Binding SelectedParameter.Name, Mode=TwoWay}"
Style="{DynamicResource BaseComboBox}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ParameterDisplayName}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 3:15
ABitSmart6-Mar-09 3:15 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 3:32
babongita6-Mar-09 3:32 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 4:55
ABitSmart6-Mar-09 4:55 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 5:08
babongita6-Mar-09 5:08 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 5:10
babongita6-Mar-09 5:10 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 5:24
ABitSmart6-Mar-09 5:24 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 5:29
babongita6-Mar-09 5:29 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 5:59
ABitSmart6-Mar-09 5:59 
GeneralRe: WPF Combobox databinding [modified] Pin
babongita6-Mar-09 6:38
babongita6-Mar-09 6:38 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 6:41
ABitSmart6-Mar-09 6:41 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 6:49
babongita6-Mar-09 6:49 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 6:56
ABitSmart6-Mar-09 6:56 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 7:02
babongita6-Mar-09 7:02 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 9:03
babongita6-Mar-09 9:03 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 17:47
ABitSmart6-Mar-09 17:47 
GeneralRe: WPF Combobox databinding Pin
ABitSmart6-Mar-09 3:05
ABitSmart6-Mar-09 3:05 
GeneralRe: WPF Combobox databinding Pin
babongita6-Mar-09 3:18
babongita6-Mar-09 3:18 

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.