Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapsed performance

Tags:

c#

wpf

Do elements with visibility set to Collapsed reduce performance when they aren't displayed?

I'm talking about large (200 items) DataGrids laying behind.

PD. I haven't built the DataGrid yet, and I don't have the actual data. Sorry if the question is not very worked, I couldn't figured out a proper manner of testing it by myself.

like image 385
Sturm Avatar asked Mar 25 '26 05:03

Sturm


1 Answers

Items with their visibility set to collapsed are still part of the layout phase, so there's a (very minor) impact to performance if you have many collapsed items. Their container still has to check to make sure they're not visible or hidden, so they'll get walked in the tree.

That being said, the impact is very small, and rarely the culprit to a real performance problem.

like image 180
Reed Copsey Avatar answered Mar 26 '26 19:03

Reed Copsey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!