Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
You might need to import the ScrollPolicy class before you can use it...
import fl.controls.ScrollPolicy;
Copy link to clipboard
Copied
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