简体   繁体   中英

WPF : The toggle button in my GridViewToggleRowDetailsColumn get visible when scrolling horizontally

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 technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM