c# - Extra space in ListBox with VirtualizingStackPanel -


i using listbox itemspanel set virtualizingstackpanel.

        <listbox itemssource="{binding items}"                  scrollviewer.verticalscrollbarvisibility="visible">             <itemscontrol.itemspanel>                 <itemspaneltemplate>                     <virtualizingstackpanel orientation="horizontal"                                         virtualizationmode="recycling"                                         horizontalalignment="stretch"                                         verticalalignment="top"                                         />                 </itemspaneltemplate>             </itemscontrol.itemspanel>              <itemscontrol.itemtemplate>                 <datatemplate>                      <datagrid                            verticalalignment="top"                           headersvisibility="none"                           itemssource="{binding distances}">                          <datagrid.columns>                             <datagridtemplatecolumn isreadonly="true" width="100">                                 <datagridtemplatecolumn.celltemplate>                                     <datatemplate>                                         <textblock text="{binding factdistance}"/>                                     </datatemplate>                                 </datagridtemplatecolumn.celltemplate>                             </datagridtemplatecolumn>                              <datagridtemplatecolumn width="100">                                 <datagridtemplatecolumn.celltemplate>                                     <datatemplate>                                         <textblock text="{binding normdistancevalue}"                                                    verticalalignment="stretch"                                                    horizontalalignment="stretch"                                                    textalignment="center"/>                                     </datatemplate>                                 </datagridtemplatecolumn.celltemplate>                             </datagridtemplatecolumn>                                <datagridtemplatecolumn width="100">                                 <datagridtemplatecolumn.celltemplate>                                     <datatemplate>                                         <textblock text="{binding normliterature}"                                                    verticalalignment="stretch"                                                    horizontalalignment="stretch"                                                    textalignment="center"/>                                     </datatemplate>                                 </datagridtemplatecolumn.celltemplate>                             </datagridtemplatecolumn>                          </datagrid.columns>                     </datagrid>                 </datatemplate>             </itemscontrol.itemtemplate>         </listbox> 

it looks ok: http://i.stack.imgur.com/53klx.png

but when horizontal scrolling quckly dragging thumb, strange space appears http://i.stack.imgur.com/ghl8k.png

and when resize window, space magically disappears. come from? how rid of it?

if use simple stackpanel fine, need use virtualization.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -