3 Replies Latest reply on Mar 10, 2009 3:10 PM by vfrvulcan

    Vertical scroll bar in datagrid

    vfrvulcan


      Hi,

      Is there any way to position the vertical scroll bar of a datagrid at the left-side of the grid?

      I have a grid where the user can select to show or hide columns. The more columns selected, the wider it gets, to the extent that it can be wider than the available display area. If the scroll bar was at the beginning it would make it easier to scroll around rather than have to scroll all the way to the right, scroll up/down and then left again to get to the beginning.

      Any help/pointers appreciated.

      Aaron
        • 2. Re: Vertical scroll bar in datagrid
          -Hob Level 1
          There's not going to be a simple way to do it. I think your greatest chance of success lies in 2 method overrides:

          1) Override updateDisplayList() and position the vertical scrollbar after calling super.updateDisplayList().
          2) Override layoutRow(). This method takes a starting x position for the items in the row (paramter is "xx"). Before calling super, add the width of the verticalScrollBar to this value, like so:

          override protected function layoutRow(more:Boolean,xx:Number,hh:Number):Number
          {
          if(this.verticalScrollBar && this.verticalScrollBar.visible)
          {
          xx += this.verticalScrollBar.width;
          }
          super.layoutRow(more, xx, hh);
          }

          Hope that helps.
          • 3. Re: Vertical scroll bar in datagrid
            vfrvulcan Level 1
            Thanks -Hob,

            Given that I'm a novice at Flex I think I'll struggle with your solution but I'll give it a go. I was hoping for something simple like selecting a right-left language to force it over!

            Many thanks for taking the trouble to help.

            Best regards

            Aaron