2 Replies Latest reply on Feb 6, 2009 7:45 AM by BrandG

    Set LineScrollSize for dynamic Scrollbar

      I have a DataGrid that recieves a big chunk of data, and will create a vertical scrollbar to handle it. However, it's too slow to scroll vertically through that data, so I wanted to change the way that it responds to arrow presses, mousewheel rolls, that sort of thing. I wanted to alter the lineScrollSize property at first, but I can't figure out how to alter the properties of an object that is apparently only created when it's needed. Is there an event that I can listen for (CreateScrollBar maybe?) or some way that I can tell the DataGrid "When you create a scrollbar, change this property"?
        • 1. Re: Set LineScrollSize for dynamic Scrollbar
          What are you trying to change it to do? Instead of scrolling a little at a time, get it to scroll much more at once (say, a whole "page" of data)?

          What about hiding the default scrollbar and putting your own on there and listening for button clicks on it to send scrollToIndex(some math here)?

          Just off the top of my head of course. :P
          • 2. Re: Set LineScrollSize for dynamic Scrollbar
            BrandG Level 1
            Well, there is a property already there (lineScrollSize) that sets how many pixels the control scrolls when it gets a scroll event. If I could affect that directly, I'd have no problem. Unfortunately, I don't know how to get access to the scrollbar for a DataGrid at creation (it looks like the scrollbar is only created when it's needed).

            I could possibly subclass the scrollbar to create a new object that only differs from the original in it's lineScrollSize, but that seems like overkill, and I'm not really sure how to link the DataGrid to that object anyway.

            Creating my own scrollbar dynamically would be even more complicated, I think. I mean, technically, there are ways to solve this problem, it just seems like one which someone else must have seen.

            Thanks for your help.