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

WPF

 
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 
babongita wrote:
I didn't check the output window to see what was happening. When I hit the dropdown on the combo I couldn't see anything in it, but the itemsource had the values.

That is because some binding is failing. If you check the Output window it would clearly mention which binding is failing and why. The comboox SelectedItem is being driven by the SelectedParamter Dependency Property. Check what value it has. If it is null(or the Name property), then the combobox cannot do anything.

babongita wrote:
But digging into the SelectedIndex seems to be the way to go here, it is performing as expected. But like I said, I will need to get the Index each time the screen loads, since the Index may change, not often but enough that I can't rely on that being the same

So, if I understand you correct, you will search for the objects in the comboxbox and set the combobox SelectedIndex to it ? Would this be on the SelectionChange of your listviewm - where you would get the listview's selected item and search that in the combobox ?

babongita wrote:
I could create a converter

Well, that seems to be a *workaround*. I would fix the damn databinding issue Smile | :)

I think you could look at this as an option,
<ComboBox x:Name="cboParameterName"
                           VerticalAlignment="Center"
                           IsSynchronizedWithCurrentItem="True"
                           TabIndex="10"
                           Grid.Column="1"
                           Grid.ColumnSpan="4"
                           ItemsSource="{Binding Path=ParameterNameCollection}"  
                           SelectedItem="{Binding Path=SelectedParameter}" 
                           Style="{DynamicResource BaseComboBox}"
                  <ComboBox.ItemTemplate>
                        <DataTemplate>
                              <TextBlock Text="{Binding Name.ParameterDisplayName}"/>
                        </DataTemplate>
                  </ComboBox.ItemTemplate>
            </ComboBox>


One more thing is, since you are driving this combobox from a listview, why don't you bind the ListView's SelectedItem to the combobox's SelectedItem ,

<ComboBox x:Name="cboParameterName"
                           VerticalAlignment="Center"
                           IsSynchronizedWithCurrentItem="True"
                           TabIndex="10"
                           Grid.Column="1"
                           Grid.ColumnSpan="4"
                           ItemsSource="{Binding Path=ParameterNameCollection}"  
                           SelectedItem="{Binding ElementName="yourListView" Path=SelectedItem}" 
                           Style="{DynamicResource BaseComboBox}"
                  <ComboBox.ItemTemplate>
                        <DataTemplate>
                              <TextBlock Text="{Binding Name.ParameterDisplayName}"/>
                        </DataTemplate>
                  </ComboBox.ItemTemplate>
            </ComboBox>


Have fun Smile | :)
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 
AnswerRe: WPF Combobox databinding Pin
Member 40355135-Mar-09 5:03
Member 40355135-Mar-09 5:03 
GeneralRe: WPF Combobox databinding Pin
ABitSmart5-Mar-09 5:14
ABitSmart5-Mar-09 5:14 
AnswerRe: WPF Combobox databinding Pin
babongita5-Mar-09 5:23
babongita5-Mar-09 5:23 
Question[Message Deleted] Pin
Prajeesh4-Mar-09 17:11
Prajeesh4-Mar-09 17:11 
AnswerRe: Free hand Line Pin
ABitSmart4-Mar-09 17:26
ABitSmart4-Mar-09 17:26 
Question[Message Deleted] Pin
Prajeesh4-Mar-09 17:33
Prajeesh4-Mar-09 17:33 
AnswerRe: Free hand Line Pin
ABitSmart4-Mar-09 17:52
ABitSmart4-Mar-09 17:52 
General[Message Deleted] Pin
Prajeesh4-Mar-09 18:06
Prajeesh4-Mar-09 18:06 

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.