# DataGrid component scrollbar

**URL:** <https://forum.kirupa.com/t/datagrid-component-scrollbar/301631>\
**Category:** flash\
**Created:** [December 12, 2009, 6:22pm UTC](https://forum.kirupa.com/t/datagrid-component-scrollbar/301631 "2009-12-12T18:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coggia](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@coggia](https://forum.kirupa.com/u/coggia)\
**Post date:** [December 12, 2009, 6:22pm UTC](https://forum.kirupa.com/t/datagrid-component-scrollbar/301631/1 "2009-12-12T18:22:57Z")

</div>

Trouble with my DataGrid component (aDg), i want to tell it to got a fixed height, and then have a scrollbar when the lines into the Datagrid are biger than its height, but with this code, it doesn’t work, the grid continues to get bigger without scrollbar :

```auto

    myDP= new DataProvider(fileXML); 
    aDg.dataProvider = myDP;  
    aDg.columns = [nameCol, numCol, prixCol];
    aDg.verticalScrollPolicy = ScrollPolicy.ON;
    aDg.width = 300; 
    aDg.height = 40; 
    aDg.rowCount = aDg.length;

```

note that this code works well if I wanted Horizontal scroll bar by replacing  
aDg.verticalScrollPolicy = ScrollPolicy.ON;  
by  
aDg.vhorizontalScrollPolicy = ScrollPolicy.ON;
