Click here to Skip to main content
15,877,967 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i fill my combobox with the following code:
<pre> var result = (from a in  dbContext.tbl_Representaion select a).ToList();
            cmbRepresentation.DisplayMemberPath = "Name";
            cmbRepresentation.SelectedValuePath = "ID";</pre>

and myXaml Code:
<pre> <ComboBox FlowDirection="RightToLeft" Height=" 25" HorizontalAlignment="Right" Margin="0,6,5,0" Name="cmbRepresentation" SelectedIndex="-1" VerticalAlignment="top" Width="100" SelectionChanged="cmbRepresentation_SelectionChanged" SelectedValue="{Binding Path=SelectedValue, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding SelectedItem}">

now ,how when load data ,I display item for ID required with selected value or selected item(not selectedIndex)?
Updated 1-Sep-15 21:34pm

1 solution

Set either the SelectedItem or the SelectedIndex
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900