Search code examples
apache-flexadvanceddatagridhorizontal-scrolling

AdvancedDataGrid horizontal/vertical scroll bar problems. (Flex)


So, I have an AdvancedDataGrid that needs to live inside a Canvas. My problem is that when you do something like this you get two sets of scroll bars. Also, the horizontal scroll bar for the AdvancedDataGrid changes size as you scroll right to left and will not let you scroll ALL the way to the right, which seems odd.

I've turned horizontal scrolling off on the AdvancedDataGrid and let only the Canvas handle it. When I do that, however, the columns don't allow themselves to be resizable. Ugh.

My current "best" solution is to have the AdvancedDataGrid handle the vertical scrolling and the Canvas handle the horizontal scrolling, but this just seems insane, not to mention I get the problem I mentioned above where I can no longer resize columns.

Any help is greatly appreciated! Thanks!


Solution

  • The AdvancedDataGrid's horizontal scrolling is somewhat peculiar, in that it sizes its horizontal scroll thumb based on the width of the visible columns. You actually can drag the thumb to the end, but it might take a couple of tries. (I know, I know ...)

    Remember that in the AdvancedDataGrid there is nothing actually rendered outside the viewport, so any sizing is just an educated (well, somewhat educated) guess. Adobe does this so that huge grids don't bog down to a crawl (imagine running measure methods on 15,000 cells' itemRenderers every time you resized the window).

    My advice is to turn off both vertical and horizontal scroll policies in the Canvas and allow the scrolling to be handled in the ADG. It's ugly, but it beats the alternative. The ADG is a cumbersome, cantankerous contraption anyway, which may be why Adobe has open-sourced it. I have sworn many times I would never use it again. I've been able to keep that vow only until the next time I needed its features. Which is about every week.