c# - Bind a collection inside a collection in WPF combobox -


observablecollection<a> work = new observablecollection<a>();      class {      int a;      int b;     observablecollection<string> c; } 

i need bind" work" itemsource of combobox , selecteditem a. need display strings(c) of class in combobox. how display strings c in combobox. idea.?

well if need each comboboxitem display collection of strings, use itemscontrol in itemtemplate of combobox.

<combobox itemssource="{binding work}">     <combobox.itemtemplate>         <datatemplate>             <stackpanel>               <textblock text={binding a} />               <textblock text={binding b} />               <itemscontrol itemssource="{binding c}" />              </stackpanel>         </datatemplate>     </combobox.itemtemplate> </combobox> 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -