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
Post a Comment