0 Replies Latest reply on Aug 6, 2010 5:00 AM by Prestine

    IMP : DataGrid Vertical Scroll Bar Issue

    Prestine

      Hello,

       

      Please run the below code at your end.

      After running, when you scroll up/down, you will notice that the size of the scroll bar is changing(increasing/ decreasing).

       

      Why size of scroll bar is not same while scrolling?

       

      Can anybody throw some light on this issue.

       

      CODE START HERE :

       

      ------------------------------------------------------------------------------------------ ------------------------------

       

      <?xml version="1.0" encoding="utf-8"?>
          <mx:Application
          xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="vertical"
          creationComplete="init()"
          >
          <mx:Script>
          <![CDATA[
          import mx.controls.dataGridClasses.DataGridColumn;
          import mx.collections.ArrayCollection;
          [
          Bindable]
          private var _dataProvider:ArrayCollection = new ArrayCollection();
          private var _arr:Array = new Array();
          private function init():void{
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ggggggggggg");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ppppppppppp\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdvxc vxcvxv\n12]vxcvxvxvxcv\n13]xvxcvxcvxvxv\n14]vxcvxvxvxvxv\n15]cvbcvbcbcbc");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ggggggggggg");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ppppppppppp\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdvxc vxcvxv\n12]vxcvxvxvxcv\n13]xvxcvxcvxvxv\n14]vxcvxvxvxvxv\n15]cvbcvbcbcbc");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ggggggggggg");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]ppppppppppp\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdvxc vxcvxv\n12]vxcvxvxvxcv\n13]xvxcvxcvxvxv\n14]vxcvxvxvxvxv\n15]cvbcvbcbcbc");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdvxc vxcvxv\n12]vxcvxvxvxcv");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]zzzzzzzzzzz7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdvxc vxcvxv\n12]vxcvxvxvxcv");
                  _arr.push("jdljgdkfg\n1serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd\ n6]qqqqqqqqqqq");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]kkkkkkkkkkk\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]kkkkkkkkkkk\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]zzzzzzzzzzz");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]qqqqqqqqqqq");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]kkkkkkkkkkk\n7]xcvdvcxvxv\n8]cvxvxvxcvx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]xxxxxxxxxxx");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]sfsdfsdfsdf");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]zzzzzzzzzzz");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]qqqqqqqqqqq");
                  _arr.push("jdljgdkfg\n1]serssdfsd\n2]sfsdfsdfsdf\n3]serssdfsd\n4]sfsdfsdfsdf\n5]serssdfsd \n6]kkkkkkkkkkk\n7]xcvdvcxvxv\n8]cvxvxvxcvx\n9]cvbdfdfgdfgcb\n10]sdfsdfsdfsdfsdf\n11]cvxdv xcvxcvxv\n12]vxcvxvxvxcv");
          _dataProvider.source = _arr;
          }
          /* private function labelfunction(item:Object, col:DataGridColumn):String{
          return item + "\n" + "dfsdfsdsdfsd";
          } */
          ]]>
          </mx:Script>
              <mx:DataGrid dataProvider="{_dataProvider}" height="400"
                           variableRowHeight="true">
              <mx:columns>
                  <mx:DataGridColumn />
                  <mx:DataGridColumn />
              </mx:columns>
              </mx:DataGrid>
          </mx:Application>

      ------------------------------------------------------------------------------------------ --------------------------------------------------------------

      CODE ENDS HERE

       

       

       

      Thanks,