Click here to Skip to main content
15,892,059 members
Home / Discussions / WPF
   

WPF

 
QuestionListbox itemtemplate binding Pin
Saurabh18cs22-Oct-15 23:07
Saurabh18cs22-Oct-15 23:07 
AnswerRe: Listbox itemtemplate binding Pin
Gerry Schmitz23-Oct-15 7:55
mveGerry Schmitz23-Oct-15 7:55 
GeneralRe: Listbox itemtemplate binding Pin
Saurabh18cs23-Oct-15 16:19
Saurabh18cs23-Oct-15 16:19 
GeneralRe: Listbox itemtemplate binding Pin
Gerry Schmitz23-Oct-15 17:21
mveGerry Schmitz23-Oct-15 17:21 
GeneralRe: Listbox itemtemplate binding Pin
Saurabh18cs23-Oct-15 20:19
Saurabh18cs23-Oct-15 20:19 
GeneralRe: Listbox itemtemplate binding Pin
Gerry Schmitz24-Oct-15 5:35
mveGerry Schmitz24-Oct-15 5:35 
QuestionWPF ListBoxItem Quick Question Pin
Kevin Marois16-Oct-15 8:17
professionalKevin Marois16-Oct-15 8:17 
SuggestionRe: WPF ListBoxItem Quick Question Pin
J. Calhoun2-Nov-15 6:22
J. Calhoun2-Nov-15 6:22 
A couple of ideas, first what is the listbox items source? Make sure that the object in the items source should have a boolean property "IsItemSelected" and that would be the property that you bind the value to, not the view model.

I made a sample object that had two properties, string Name and bool IsItemSelected

I added that to an observable collection (yourList) and then I define the ListBox and the container style as such
HTML
<ListBox ItemSource="{Binding yourList}" DisplayMemberPath="Name">
    <ListBox.ItemContainerStyle>
        <Style TargetType="{x:Type ListBoxItem}">
            <Setter Property="IsSelected" 
                Value="{Binding IsItemSelected}"/>


If this is not working then the fault might be in your view model, things to make sure are are you implementing INotifyPropertyChanged? Is your event set up correctly? If this is still not working and you would like to post your view model I would be happy to help.

Cheers!
QuestionSelectionChanged event is not working Pin
Ashfaque Hussain15-Oct-15 1:52
Ashfaque Hussain15-Oct-15 1:52 
AnswerRe: SelectionChanged event is not working Pin
Richard Deeming15-Oct-15 2:48
mveRichard Deeming15-Oct-15 2:48 
QuestionCheckbox IsChecked property is not binding Pin
Ashfaque Hussain14-Oct-15 2:01
Ashfaque Hussain14-Oct-15 2:01 
AnswerRe: Checkbox IsChecked property is not binding Pin
Richard Deeming14-Oct-15 2:31
mveRichard Deeming14-Oct-15 2:31 
GeneralRe: Checkbox IsChecked property is not binding Pin
Ashfaque Hussain14-Oct-15 19:32
Ashfaque Hussain14-Oct-15 19:32 
AnswerRe: Checkbox IsChecked property is not binding Pin
Meshack Musundi14-Oct-15 23:54
professionalMeshack Musundi14-Oct-15 23:54 
GeneralRe: Checkbox IsChecked property is not binding Pin
Ashfaque Hussain15-Oct-15 1:56
Ashfaque Hussain15-Oct-15 1:56 
GeneralRe: Checkbox IsChecked property is not binding Pin
Meshack Musundi15-Oct-15 3:10
professionalMeshack Musundi15-Oct-15 3:10 
QuestionWPF Binding Issue Pin
Saurabh18cs12-Oct-15 17:55
Saurabh18cs12-Oct-15 17:55 
QuestionRe: WPF Binding Issue Pin
Meshack Musundi13-Oct-15 20:13
professionalMeshack Musundi13-Oct-15 20:13 
AnswerRe: WPF Binding Issue Pin
Priyank612515-Oct-15 0:24
Priyank612515-Oct-15 0:24 
QuestionGet Info Pin
ASPDevloper8-Oct-15 18:47
ASPDevloper8-Oct-15 18:47 
AnswerRe: Get Info Pin
Mycroft Holmes8-Oct-15 20:26
professionalMycroft Holmes8-Oct-15 20:26 
Questionsetting image in nested menu Pin
HailStorm26-Oct-15 4:05
HailStorm26-Oct-15 4:05 
AnswerRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 4:30
mvePete O'Hanlon6-Oct-15 4:30 
GeneralRe: setting image in nested menu Pin
HailStorm26-Oct-15 19:26
HailStorm26-Oct-15 19:26 
GeneralRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 21:01
mvePete O'Hanlon6-Oct-15 21:01 

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.