View Full Version : All the datagrid column are not resizing proportionalily when resize the browser
sipra
02-11-2009, 01:16 PM
Hi,
I have a datagrid with some columns and most of the columns have header renderer.Now when I resize the browser all the datagrid columns are not resizing proportionaly.The last column effected only.Is there any cause for the header renderer in the datagrid column?
If any solution have then please suggest.Thanks in advance.
wvxvw
02-11-2009, 01:54 PM
If you don't set the width of the colomn it'll be calculated based on the length of the header for that column. So, probably, you'll need to listen to the resize event, and reset the columns width depending on the entire application width:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
paddingLeft="0"
paddingRight="0">
<mx:DataGrid width="100%">
<mx:dataProvider>
<mx:XMLList>
<node column1="Foo" column2="Bar"/>
<node column1="Foo" column2="Bar"/>
<node column1="Foo" column2="Bar"/>
<node column1="Foo" column2="Bar"/>
<node column1="Foo" column2="Bar"/>
</mx:XMLList>
</mx:dataProvider>
<mx:columns>
<mx:DataGridColumn
width="{width / 2}"
dataField="@column1"
headerText="Column 1"/>
<mx:DataGridColumn
width="{width / 2}"
dataField="@column2"
headerText="Column 2"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.