c# - listview wrappanel not working when ungrouped -
i'm adapting solution needs: http://www.abhisheksur.com/2010/08/woring-with-icollectionviewsource-in.html
the xaml part of listview is:
<listview grid.row="1" name="lvicons" itemssource="{binding}"> <listview.groupstyle> <groupstyle> <groupstyle.headertemplate> <datatemplate> <textblock text="{binding name}" /> </datatemplate> </groupstyle.headertemplate> </groupstyle> </listview.groupstyle> <listview.itemspanel> <itemspaneltemplate> <wrappanel width="{binding (frameworkelement.actualwidth), relativesource={relativesource ancestortype=scrollcontentpresenter}}" itemwidth="{binding (listview.view).itemwidth, relativesource={relativesource ancestortype=listview}}" minwidth="{binding itemwidth, relativesource={relativesource self}}" itemheight="{binding (listview.view).itemheight, relativesource={relativesource ancestortype=listview}}" /> </itemspaneltemplate> </listview.itemspanel> </listview>
i've got button control if want show grouped or not , code behind button is:
private void btngroup_click(object sender, routedeventargs e) { this.source.groupdescriptions.clear(); propertyinfo pinfo = typeof(country_icon).getproperty(cmbgroups.text); if (pinfo != null) this.source.groupdescriptions.add(new ropertygroupdescription(pinfo.name)); }
when grouping on, wrappanel working nicely (i'm grouping integer property on icons)
but when grouping not on, no wrapping:
i'm not worried different sizes of icon's - i'll fix later.
how fix wrapping when not grouped ? there different template in use ?
thanks answer of question wpf listview horizontal arrangement of items? me now.
Comments
Post a Comment