Hi all,
I have a datagrid that has longer data in some rows than others. The 
problem is that my scrollbar is changing size! Does anyone know how 
to stop the scrollbar changing height?

A sample code is below.

Thanks
Shaun





Code:


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

    <mx:XMLList id="employees">
        <employee>
            <name>Christina Coenraets</name>
            <phone>555-219-2270</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Joanne Wall</name>
            <phone>555-219-2012</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Maurice Smith</name>
            <phone>555-219-2012</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>false</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>Headmaster of Hogwarts School of Witchcraft and 
Wizardry     

Order of Merlin and other honors.     

Chocolate Frog card: "Considered by many the greatest wizard of 
modern times. Dumbledore is particularly famous for his defeat of the 
dark wizard Grindelwald in 1945, for the discovery of the twelve uses 
of dragon's blood, and his work on alchemy with his partner, Nicolas 
Flamel. Prof. Dumbledore enjoys chamber music and tenpin 
bowling."      

"Nitwit! Blubber! Oddment! Tweak!"     

Shining silver hair.     

"Men have wasted away before [the Mirror of Erised], entranced by 
what they have seen, or been driven mad, not knowing if what it shows 
is real or even possible."     

Rigged mirror to help those who wanted to find the stone but not.

"Nitwit! Blubber! Oddment! Tweak!"     

Shining silver hair.     

"Men have wasted away before [the Mirror of Erised], entranced by 
what they have seen, or been driven mad, not knowing if what it shows 
is real or even possible."     

Rigged mirror to help those who wanted to find the stone but not use 
it.      

Spiral escalator to office; large and beautiful circular room.     

Auburn hair 50 years ago.     

Suspended as headmaster.            
            </email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>

    </mx:XMLList>

<mx:Style source="style.css"/>

    <mx:Panel title="DataGrid Control Example" 
        paddingTop="10" paddingLeft="10" paddingRight="10" 
width="798" height="513">

        <mx:Label width="100%" color="blue"
            text="Select a row in the DataGrid control."/>

        <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" 
dataProvider="{employees}" variableRowHeight="true"
 verticalScrollPosition="">
            <mx:columns>
                <mx:DataGridColumn dataField="name" 
headerText="Name"/>
                <mx:DataGridColumn dataField="phone" 
headerText="Phone"/>
                <mx:DataGridColumn dataField="email" 
headerText="Email"/>
            </mx:columns>
        </mx:DataGrid>

        <mx:Form width="100%" height="100%">
            <mx:FormItem label="Name">
                <mx:Label text="{dg.selectedItem.name}"/>
            </mx:FormItem>
            <mx:FormItem label="Email">
                <mx:Label text="{dg.selectedItem.email}"/>
            </mx:FormItem>
            <mx:FormItem label="Phone">
                <mx:Label text="{dg.selectedItem.phone}"/>
            </mx:FormItem>
        </mx:Form>
        
    </mx:Panel>
</mx:Application>

Reply via email to