I'm using an ItemSelector with two lists like the second one from this demo:
http://dev.sencha.com/deploy/dev/examples/multiselect/multiselect-demo.html
I have around 600 items in my first list and the performance when I drag the scrollbars is unacceptable in Firefox 3.x. For some reason, IE7 is not a problem. Are there any optimizations than can be done so scrolling will be faster?
[Update]
Seems like the problem occurs when the widget is placed in a xtype: 'fieldset'
The problem goes away once the widget is moved out of the fieldset.
did you try disabling firebug ?
In the demo I can't see any events firing on scrolling up and down.
Possibly you have some set up in yours.
You could possibly override the renderer of the list to use fewer elements, it's currently three per item. Not holding out a huge amount of hope on that front however.
Your best solution is likely to find a way to not have 600 items displayed on the page at a time.
Related
I have a radgridview with a GridViewToggleRowDetailsColumn and I can set the visibility of the GridViewToggleButton the way I want through the RowLoaded event for each row. It was working fine until I need to scroll horizontally. When the GridViewToggleRowDetailsColumn get out of the screen and I scroll back to it, the GridViewToggleButton are now all visible.
I tried to find any event triggered by this without success. Even the IsVisibleChanged event attached to the GridViewToggleButton seems to be triggered only on the visible one.
Does anyone faced the same issue or have any idea of what could produce this behavior ?
Edit: Found the answer. It was a virtualization issue. Adding EnableColumnVirtualization="False" in the gridview properties solved it.
https://docs.telerik.com/devtools/wpf/controls/radgridview/features/ui-virtualization
After a few minutes of research, it appears that telerik WPF GridView uses virtualization to improve performace. This means that the state of what is in the screen is retained and as things leave your viewing area they are destroyed. This frees up memory space significantly, however can have some side effects as you are experiencing.
You can set EnableColumnVirtualization=false however Telerik has provided a help article that will likely answer your question more directly while not sacrificing the performance provided by the virtualizations. A link is below and following through the steps, it looks fairly straightforward.
https://docs.telerik.com/devtools/wpf/controls/radgridview/style-selectors/cell-style-selector
The recommended approach for customizing this behavior, and not turning off the virtualization, is to use a custom column. Try inheriting from GridViewToggleRowDetailsColumn and override CreateCellElement. It is the callback for creating the visual element in the cell, which is called, more or less, at the same time as RowLoaded. Then return null for those rows that you don't want to have a button for.
I have a relatively large array (lets say 500 items) of complex objects and currently using md-virtual-repeat to render the UI and scroll though the items (of a fixed size) without a problem. Due to UI changes in the system it is required to add item expansion ability (resizing, something like collapse\expand for each item). For small arrays (up to ~20) the scrolling still works without issues. The problem starts for larger arrays and some items expanded. The scrolling becomes choppy and not all expanded data is shown since the virtual repeater replaces items while scrolling. I'm looking for a workaround of this issue, OR an alternative solution (maybe another library?). Any ideas?
In order to use the browser level scroll instead of grid level scroll I made domLayout = 'autoHeight' which actually did what I wanted but it is crashing the browser is there any solution to this, I searched for this but didn't find any solution, if anyone have solution for this even a reference link would be helpful.
If you do this, you are getting rid of row virtualization, so you are actually loading as many rows you are passing at once, note that this is not an ag-grid limitation, this is just the fact that you are passing too much data and running out of memory
If you have too much data, in ag-grid you are going to have either pagination or scroll, so that the rows are virtualized and then you don't crash the browser
Hope this helps
At a high level my application is applying about 5 different DataTemplates to a set of ListBoxItems based on their type. These items are laid out on a canvas at specific x, y points. I implemented virtualization on my ListBox and it did not seem to improve the time it takes to complete the rendering thread's processes. It still takes about 8-12 seconds for the UI to be completely loaded and usable by the user. I thought virtualization would help fix this problem but after looking around it looks like it only helps process scrolling large amounts of data. Am I correct in this assumption and does anyone else have any other tips for improving the rendering thread. This is the only problem I am having and then my project is complete. Thanks StackOverflow!
Virtualisation means that only the items you have visible are created, then dynamically destroyed/new items created as you scroll. The alternative is all UI controls are created for all items at once.
It sounds like you have bigger problems with the rest of the app. Do you perform all loading operations on a background thread? Is the UI control tree very complex indeed? Are you displaying 100s or 1,000s of items?
We also had a lot of trouble with performance in WPF. Best way is of course to profile your application. We use ANTS Performance profiler for that, but any .NET profiler will do. We got a huge performance hit, because of the lookup of our XAML Resources. Thats the advice i can give you:
Try to minimize all resources in XAML. But not only that, also try to minimize the amount of XAML files you have. One thing you can try is to defere the loading of complex parts of your DataTemplate. Similiar to what happens when you load a JPEG in a browser, first you will see a pixelated image which will be finer after it finished loading the JPEG. To accomplish that, use a simpler DataTemplate at first and then if this is visible only load the complex template on demand or after a while.
But without more information of your specific problem, we can only guess. This is an old question of mine about a similiar subject, maybe this will help aswell.
Yes, ListBox virtualization is for scrolling. When you have a large number of items in a ListBox, enabling virtualization will make only the visible items (+ a few extra items for scrolling) render, and scrolling the ListBox replaces the data in the rendered items instead of rendering new items.
If you were to post some code, perhaps we could assist you with some performance tweaks
We had issue with the Scrolling of the WPF datagrid. With some analysis found the ScrollViewer.CanContentScroll = true was the culprit. Removing and making it false, the scrolling issue was fixed. BUT yesterday i was analyzing a bug on increase in memory footprint of the WPF application to more than 1.3Gb due to binding a 50k records by mistake. Still it questioned the capabilities of binding even a 10k records. Users dont want pagination. ( its a requirement, cant do much about it!)
On further reader found setting ScrollViewer.CanContentScroll = false makes UI virtualization false. which is making WPF bind all the records and render it on the screen. Which results in exploded memory foot print and performance issues.
For now we thought if the records to be bound are minimal, then set the ScrollViewer.CanContentScroll= false, else set it true.
In short: we are either stuck with scrolling issue or UI virtualization. Is there something which can fix both? Have read about Data Virtualization but do we really need to go that far? am i missing anything out of the box from .net4.0 which could help us?
If you check out the accepted answer of this question... In the 'Choosing between them' section of the answer there is a suggested tip to set the visibility of a custom decorator to hidden when the item is not in view.
But other than that... you're right. You either get smooth scrolling or virtualization... not both.
Additionally, if you group items in your datagrid, check out this answer I posted a while back for a convenient performance improvement.