xaml - Remove space between GridView Groups -
xaml - Remove space between GridView Groups -
i have list of people grouped first letter of name.
the result follow :
the problem space between groups d , g, how can remove it?
the groupstyle declare :
<gridview.itemtemplate> <datatemplate> <border width="150" height="150" background="#fff14b01"> <grid> <grid.rowdefinitions> <rowdefinition height="30" /> <rowdefinition height="30" /> </grid.rowdefinitions> <textblock text="{binding name}" verticalalignment="center" foreground="white" /> </grid> </border> </datatemplate> </gridview.itemtemplate> <gridview.groupstyle> <groupstyle hidesifempty="true"> <groupstyle.headertemplate> <datatemplate> <grid margin="1,0,0,20"> <textblock fontweight="bold" style="{staticresource subheadertextstyle}" text="{binding title}" /> </grid> </datatemplate> </groupstyle.headertemplate> <groupstyle.panel> <itemspaneltemplate> <variablesizedwrapgrid margin="0,0,80,0" itemheight="150" itemwidth="150" /> </itemspaneltemplate> </groupstyle.panel> </groupstyle> </gridview.groupstyle>
there no keys empty collection in key / value collection.
in fact, if grouping 'a' on 5 columns, each groups have 5 columns space if there 1 item.
so, in picture, d has 3 column space , g too.
thanks in advance
edit :
problem solved adding this:
<gridview.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"/> </itemspaneltemplate> </gridview.itemspanel>
thanks answers
i think reason of empty area have empty instances of class provides names , letters. if there no such thing, guess solution well:
create property in source returns whether there element in sequence - can done homecoming visibility.
class="lang-cs prettyprint-override">public visibility isvisible { { homecoming key == "" ? visibility.collapsed : visibility.visible; } }
then bind visibility of grid.
xaml windows-8 windows-runtime
Comments
Post a Comment