wpf - Can use a wrappanel with datatemplate for horizontal alignment of items in a listbox -
i trying horizontally align items in listbox(items checkbox items). how can use wrap panel datatemplate?
<listbox name="horizontal" itemssource="{binding solution}" scrollviewer.horizontalscrollbarvisibility="disabled" > <listbox.itemtemplate > <datatemplate > <checkbox content="{binding name}" ischecked="{binding ischecked}" margin="5 5 0 0"/> </datatemplate> </listbox.itemtemplate> </listbox>
i think want itemspanel
property:
<listbox name="horizontal" itemssource="{binding solution}" scrollviewer.horizontalscrollbarvisibility="disabled"> <listbox.itemspanel> <itemspaneltemplate> <wrappanel orientation="horizontal"/> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <checkbox content="{binding name}" ischecked="{binding ischecked}" margin="5 5 0 0"/> </datatemplate> </listbox.itemtemplate> </listbox>
Comments
Post a Comment