5 Replies Latest reply: Nov 16, 2011 10:40 PM by Joselyn6 RSS

    Scrollbar of Datagrid Flash as3

    Joselyn6 Community Member

      Hello to all:

       

      Somebody can tell me, How remove the scrollbar from the datagrid to display a list that it grows as large or small like the list size?

      and how to appear the scrollbar in the stage?

       

      thanks in advance.

       

      Regards.

      Joselyn

        • 1. Re: Scrollbar of Datagrid Flash as3
          Ned Murphy MVP

          You should look thru the help documents and review all of the DataGrid's properties.  You will find properties that help you determine the width and height values and others that allow you to set whteher or not the scrollbars appear.  For instance. the following could make the DataGrid adjust its size for the number of rows it holds...

           

          dataGrid.height = dataGrid.headerHeight+dataGrid.length*dataGrid.rowHeight;

           

          And the following will set the vertical scrollbar to not appear...

           

          dataGrid.verticalScrollPolicy = ScrollPolicy.OFF;

          • 2. Re: Scrollbar of Datagrid Flash as3
            Joselyn6 Community Member

            Hello Ned, Thanks very much, for answer me, as you say I've viewed the help documents and review all of the DataGrid's properties, and I finded the properties of the verticalScrollPolicy and I've set the

            aDg.horizontalScrollPolicy = ScrollPolicy.OFF; but it show me this error

            "1119: Access to a possibly undefined ScrollPolicy property through a reference with static type fl.controls: DataGrid."

            I think the error should not have because it is a property, Isn´t it?

             

             

             

            • 3. Re: Scrollbar of Datagrid Flash as3
              Joselyn6 Community Member

              Hello Ned,

               

              Please, excuseme because I make a mistake I wanted to say "aDg.verticalScrollPolicy = ScrollPolicy.OFF.

              instead aDg,horizontalScrollPolicy = ScrollPolicy.OFF"

               

              Thanks in advance Ned.

               

              Regards

              Joselyn

              • 4. Re: Scrollbar of Datagrid Flash as3
                Ned Murphy MVP

                You might need to import the ScrollPolicy class before you can use it...

                 

                import fl.controls.ScrollPolicy;

                • 5. Re: Scrollbar of Datagrid Flash as3
                  Joselyn6 Community Member

                  Hello Ned, I did it, I import fl.controls.ScrollPolicy and doesn't ticking error thank you, but it does not display the list the datagrid, do you have any idea, why doesn't works?

                   

                  Here is the code you advice:

                   

                  aDg.height = aDg.headerHeight+aDg.length*aDg.rowHeight;

                   

                  aDg.verticalScrollPolicy = ScrollPolicy.OFF;

                   

                  Thanks for any help.

                   

                  Regards

                  Joselyn