sorting - WPF DataGrid loses virtualization when sorted by specific columns -


i using wpf datagrid bound custom itemssource implements ilist (and not ienumerable). custom itemssource performs data virtualization , loads pages of items needed. mydatagrid inherits datagrid , overrides handling of datagrid sort methods can maintain data virtualization while sorting. have ui virtualization turned on mydatagrid.

when run application, mydatagrid displays fine, tells me have 20,000 items, , asks itemssource first 20 or items. can click on column headers sort various columns , again itemssource has reload first page of 40 items because mydatagrid has asked refresh first 20 or so.

but, when click on last name column sort, mydatagrid loses ui virtualization , asks itemssource load every single item though needs first 20 or so. can watch asks every single item index (this[0]).

i've tried researching icollectionview, ui virtualization, , data virtualization , thing i've read seems may apply regarding multiple row selection (at datagrid row request patterns data virtualization i've set mydatagrid's selectionmode single shouldn't apply.

another hint may that, prior sorting last name, first item in mydatagrid has last name starts letter v (very late in alphabet), , can sort list in descending order last name without losing virtualization. same thing happens title column has first item starts letter s. don't have problem of other columns.

any ideas?

figured out!!! looking through call stack, appeared problem happening during measureoverride of virtualizingstackpanel , noticed calling syncuniformsizeflags method. went default style datagrid , set rowheight fixed amount , no longer causes problem.

so, appears datagrid can lose virtualization when fixed rowheight not set. still don't know why opting sort in ascending order last name or title caused want resync row heights, can work around one.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -