I have re-styled a ListBox to create a RadioButtonList from this link
My requirement is something like this : I have to select a single item from the ListBox at a time(ie Single Selection Mode). Also I have to disable/enable ListBoxItem based on property that bind to the collection. So I have set
IsChecked="{TemplateBinding IsSelected}"
and bound the IsEnabled property from my collection.
IsEnabled="{Binding IsEnabled}"
And the result as follows:
You can see that some of the records are in disabled state, but still they are selectable.If I remove the IsChecked property, it works perfectly as expected. But I need both the IsEnabled & IsSelected functionlaity. Then I create a multivalue converter for the IsEnabled property and based on the values I have bind the corresponding value to the property. Now I can't select a disabled item from list visually. But when I select a disabled item, I loss the selection. Please check the image : .
and in code behind the IsChecked property is set to the first record. I want to restrict this selection. How can I do that? Is there any settings in xaml will help to do my requirements? Please advice...
Thanks in advance....