2 Replies Latest reply on Feb 18, 2010 10:50 AM by David_F57

    Resize grid

    JockMahon Level 1

      Does anyone have a good example of a grid that changes sizes and the column maintain a percentage of the total grid width

      basically i want to do some thing like

       

      <mx:DataGridColumn headerText="Qty"

      dataField="qty"

      width="20%"

      minWidth="40"/>

       

      but the % is not allowed for the DataGridColumn

       

      thanks

        • 1. Re: Resize grid
          David_F57 Level 5

          Hi,

           

          you could try something like this

           

           

          <mx:DataGrid  id="dg" x="783" y="353" width="400">

          <mx:columns>

          <mx:DataGridColumn headerText="Column 1" dataField="col1" width="{dg.width*0.25}"/>

          <mx:DataGridColumn headerText="Column 2" dataField="col2" width="{dg.width*0.35}"/>

          <mx:DataGridColumn headerText="Column 3" dataField="col3" width="{dg.width*0.40}"/>

          </mx:columns>

          </mx:DataGrid>

          David

          • 2. Re: Resize grid
            JockMahon Level 1

            hey i had tried

             

            width="{(dg.width/100) *20}"

             

            but was not sure if this was the best / only way to do it

             

            thanks