4

I am using the VirtualTreeView together with the OnMeasureItem event to display rows of variable size. The problem is that the event seems to be called only if a row is painted (following the virtual paradigm). But this leads to the scrollbar being displayed incorrectly. If I scroll to the bottom (by dragging the scrollbox with the mouse, not clicking the scroll buttons at the top or bottom), not the last row is displayed (which is what I would expect), but some row in the middle. After that, the scrollbar is updated and I can scroll further down. It seems as if the component uses the DefaultNodeHeight for its scrolling calculations. But since my rows have variable height, I cannot specify a DefaultNodeHeight that would lead to correct results. Option toVariableNodeHeight is enabled.

Has anyone experienced this before and maybe found a workaround? Or am I doing it wrong?

jpfollenius
  • 16,456
  • 10
  • 90
  • 156
  • Just for sure. Do you have `toVariableNodeHeight` option included in the `TreeOptions.MiscOptions` set, do you ? Could you include this information into your question as well as the version of VirtualTreeView are you using, please ? – TLama Mar 05 '13 at 12:23
  • `toVariableNodeHeight` makes no difference - I tried both. I am on revision 431 which is from november 2012. – jpfollenius Mar 05 '13 at 12:40

1 Answers1

4

You need to set DefaultNodeHeight to the maximum value you will be using and OnMeasureItem event set custom height value for the current node. Similar issue was described here.

Community
  • 1
  • 1
Linas
  • 5,485
  • 1
  • 25
  • 35