Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
In am working on MVVM based WPF application. In my application, i will be reading/saving my data to the data base (SQL compact .sdf file)
I have list of records displayed in a list box. when i select a record from the list box, the corresponding data gets loaded on the screen.
I have set of radio buttons in my application.

My problem is:
When i load a record for the first time, the radio options are getting set properly but, when i go to other window and come to to the original window, the record in the list box is being shown as selected and all the otehr data (displayed in the textboxes)are being showed but my none of the radio options are not getting selected.

Can anyone let me know what could be the reason.

For reference i am pasting XAML code for my radio buttons.
XML
<StackPanel Visibility="Visible">
  <RadioButton Name="rbtnUDBL" Command="{Binding RadioBoxCommand}" GroupName="Co" Content="Option1" IsChecked="{Binding Path=DisplayedProperty, Converter={StaticResource BooleanToStringValueConverter}, ConverterParameter='0'}"></RadioButton>
  <Separator Height="10" Visibility="Hidden"></Separator>
  <RadioButton Name="radioButton2" Command="{Binding RadioBoxCommand}" GroupName="Co" Content="Option2" IsChecked="{Binding Path=DisplayedProperty, Converter={StaticResource BooleanToStringValueConverter}, ConverterParameter='1'}"></RadioButton>
  <Separator Height="10" Visibility="Hidden"></Separator>
  <RadioButton Name="radioButton3" Command="{Binding RadioBoxCommand}" GroupName="Co" Content="Option3" IsChecked="{Binding Path=DisplayedProperty, Converter={StaticResource BooleanToStringValueConverter}, ConverterParameter='2'}"></RadioButton>
  <Separator Height="10" Visibility="Hidden"></Separator>
</StackPanel>
Posted
Updated 18-Nov-14 23:53pm
v3
Comments
Tomas Takac 19-Nov-14 5:40am    
What do you mean by "go to other window"? You close this window and then reopen it?
Info7410 19-Nov-14 6:02am    
Yes, I am showing another window and then closing the original window. Now when i come back to my original window (having radio buttons), i am getting this problem :(

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