3 Replies Latest reply on Sep 8, 2009 8:52 AM by Andrew Rosewarn

    Advanced data grid resizing




      If I pin an advanced data grid to a canvas in all four corners and resize the canvas, the height of the data grid will change to fit the canvas but the width of the data grid will not change.


      How do I configure the data grid to change its width when the canvas width changes?

        • 1. Re: Advanced data grid resizing
          Andrew Rosewarn Level 3



          How are you pinning the datagrid in the canvas.  Are you setting the left, right, top and bottom properties to 0.  I have just done the following and am having no problems?


          Perhaps you could provide more details.


          <?xml version="1.0"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">


              <mx:Canvas left="84" right="110" top="82" bottom="74">
                  <mx:AdvancedDataGrid id="adg1" designViewDataType="tree" left="0" right="0" top="0" bottom="0">
                          <mx:AdvancedDataGridColumn headerText="Column 1" dataField="col1"/>
                          <mx:AdvancedDataGridColumn headerText="Column 2" dataField="col2"/>
                          <mx:AdvancedDataGridColumn headerText="Column 3" dataField="col3"/>





          • 2. Re: Advanced data grid resizing
            bk843746 Level 1

            Hi Andrew


            I forgot to mention that I was creating the canvas and adding it to a tab navgiator with code. I see the problem now. I need to set the left, top, right and bottom properties of the canvas after I create it.


            How is this done? The canvas class doesn't have these properties.



            • 3. Re: Advanced data grid resizing
              Andrew Rosewarn Level 3



              Sorry I shouldn't have used the term properties, they are styles.


              <?xml version="1.0"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
                          private function init():void {
                  <mx:Canvas id="can" x="99" y="121" width="200" height="200" backgroundColor="#C58E8E">