How can I virtualize a "datagrid like" Control Horizontally and Vertically on XAML/C# (Windows 8.1 - WinRT) -
problem
i'm trying create "datagrid like" control on universal app (winrt).
control has show lots of elements (cells) has small view-area, it's perfect candidate virtualization, needs.
how can have virtualization both horizontally , vertically such thing?
what tried (one-direction virtualization)
i have tried using both listview, gridview , itemscontrol. managed have vertically or horizontally virtualization those.
the important thing had achieve one-direction virtualization , have table changing itemspanel of of (listview/gridview/itemscontrol) this:
<scrollviewer verticalscrollbarvisibility="auto" horizontalscrollbarvisibility="auto" horizontalscrollmode ="auto" verticalscrollmode ="auto" zoommode="disabled" viewchanged="datagridview_onviewchanged" width="700"> <itemscontrol verticalalignment="top" horizontalalignment="left" itemssource="{binding cells}" width="{binding datagridwidth}"> <itemscontrol.itemspanel> <itemspaneltemplate> <itemswrapgrid maximumrowsorcolumns="{binding numberofcolumns}" virtualizingstackpanel.virtualizationmode="recycling" itemwidth="{binding cellwidth}" itemheight="{binding cellheight}" cachelength="2.0" verticalalignment="top" horizontalalignment="left" orientation="horizontal"/> </itemspaneltemplate> </itemscontrol.itemspanel> ... </itemscontrol> </scrollviewer>
note: "virtualizingstackpanel.virtualizationmode" , "cachelenght" not necessary in there. notice i'm setting width on scrollviewer , itemscontrol. think that's culprit in making virtualized in 1 direction. because i'm giving itemscontrol enough room display items. problem is, it's way make maximumrowsorcolumns work , achieve "datagrid like" control.
this solution starts becoming sluggish/broken @ 100 x 100 elements because if it's displaying 10 rows, it's still 10x100 cells draw.
the cells have same , feel , therefore share same datatemplate should getting solution.
i can use control, mentioned listview, gridview , itemscontrol because ones more obvious me (to solve problem).
any ideas on how achieve two-direction (horizontal , vertical) virtualization "datagrid like" control on windows universal apps xaml/c#?
note 2: wpf solutions won't work winrt xaml/c#. please check before posting wpf solution.
i haven't done this, found few interesting articles:
1) grid located in scrollviewer, how trying use attached propery virtualizingstackpanel.virtualizationmode?
2) if previous doesn't work you, guess can write own virtualization mechanism using incremental virtualization article ( think can used ).
link: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh780657.aspx
Comments
Post a Comment