wpf - Binding a Combobox inside a ListView -


i have combobox in listview can bind itemsource. when selecting value in combobox, selected item not getting set. can show me why selected item (numberofiterations) not getting set? combobox works when move outside listview, making me thinkg not have binding correct, cannot figure out wrong. use simplemvvmtoolkit framework.

<listview grid.row="1" grid.column="2"      itemssource="{binding sequencelistitems}"      selecteditem="{binding sequencelistitemselected}"      itemcontainerstyle="{staticresource alternatinglistviewitemstyle}"      alternationcount="2"> <listview.view>     <gridview>         <gridviewcolumn header="# of iterations" width="125">             <gridviewcolumn.celltemplate>                 <datatemplate>                     <stackpanel>                         <combobox itemssource="{binding sequenceeditorviewmodel.iterations, source={staticresource viewmodellocator}}"  selecteditem="{binding path=numberofiterations, mode=twoway}" selectedindex="0"  fontweight="bold" verticalalignment="center" width="60" />                     </stackpanel>                 </datatemplate>             </gridviewcolumn.celltemplate>         </gridviewcolumn>     </gridview> </listview.view> </listview> 

viewmodel items...i not using model @ time

// constructor public sequenceeditorviewmodel() {     // populate iterations displaying in combobox in gridview.     (int x = 1; x <= 50; x++)     {         this.iterations.add(x);     } }  //public property (iterations source combobox , numberofiterations  //is selected item in combobox) public observablecollection<int> iterations {         {         return this.iterations;     }      set     {         this.iterations = value;          this.notifypropertychanged(m => m.iterations);     } }  public int numberofiterations {         {         return this.numberofiterations;     }      set     {         this.numberofiterations = value;          this.notifypropertychanged(m => m.numberofiterations);     } } 


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -