How to make the AdvancedDataGrid column widths are consistent in flex

I have a ADG. when i moving from screen to screen, the columns in ADG are resizing. but i dont want to resize them automatically.

i want the column widths to be the original column widths.
        <mx:AdvancedDataGridColumn id="listNameCol" dataField="name" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.NameHeader')}" width="250" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="template" dataField="istemplate"	showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.TypeHeader')}" width="80" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="typeCol" dataField="type" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.PageTypeHeader')}" width="80" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="versionCol" dataField="latestrevision" showDataTips="true"	headerText="{resourceManager.getString('locale', 'webPageManager.VersionHeader')}" width="50" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="categoryCol" dataField="{ModelLocator.getInstance().commonManager.dataFieldName4WPMgrGrid}"	headerText="{ModelLocator.getInstance().commonManager.folderCatHeaderLabel}" width="100" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="previewCol" dataField="preview" showDataTips="true"	sortable="false" headerText="{resourceManager.getString('locale', 'webPageManager.PreviewHeader')}" width="50" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="hostStatusCol" dataField="latesthostedstatus" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.HostStatusHeader')}" width="80" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridColumn id="urlCol" dataField="latestwebhosturl" showDataTips="true" sortable="false" headerText="{resourceManager.getString('locale', 'webPageManager.URLHeader')}" width="70" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
		<mx:AdvancedDataGridColumn id="createdOnCol" dataField="createddate" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.CreatedOnHeader')}" width="115" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
		<mx:AdvancedDataGridColumn id="lastUsedCol" dataField="lastusedon" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.LastUsedDateHeader')}" width="115" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
		<mx:AdvancedDataGridColumn id="timesUsedol" dataField="nooftimesused" showDataTips="true" headerText="{resourceManager.getString('locale', 'webPageManager.TimesHeader')}" width="50" headerRenderer="com.zetainteractive.view.Renderers.Datagrid.DGHeaderRenderer"/>
        <mx:AdvancedDataGridRendererProvider column="{listNameCol}"
        <mx:AdvancedDataGridRendererProvider column="{template}"
        <mx:AdvancedDataGridRendererProvider column="{typeCol}"
        <mx:AdvancedDataGridRendererProvider column="{versionCol}"
        <mx:AdvancedDataGridRendererProvider column="{categoryCol}"
        <mx:AdvancedDataGridRendererProvider column="{previewCol}"
        <mx:AdvancedDataGridRendererProvider column="{hostStatusCol}"
        <mx:AdvancedDataGridRendererProvider column="{urlCol}"
        <mx:AdvancedDataGridRendererProvider column="{createdOnCol}"
        <mx:AdvancedDataGridRendererProvider column="{lastUsedCol}"
         <mx:AdvancedDataGridRendererProvider column="{timesUsedol}"

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zzynxSoftware engineerCommented:
>> when i moving from screen to screen, the columns in ADG are resizing.
I don't understand what you mean with this.
Could you explain a little bit more? Maybe with some screen shots?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vmaradaAuthor Commented:
I mean, when i navigate from any screen to Datagrid screen, i observed that the width of the columns are changed.
zzynxSoftware engineerCommented:
First of all, as far as I know that isn't standard behaviour at all.

In the Flex help file I read (for the width property of AdvancedDataGridColumn):
The width of the column, in pixels. If the AdvancedDataGrid's horizontalScrollPolicy property is false, all visible columns must fit in the displayable area, and the AdvancedDataGrid will not always honor the width of the columns if the total width of the columns is too small or too large for the displayable area.

Is the horizontalScrollPolicy property of your AdvancedDataGrid set to true? Otherwise the above indicates the width settings won't always be honored.

If that doesn't help, the only thing I can think of are the renderers. You could do a test and remove all renderers and see if the problem persists.
Turn Raw Data into a Real Career

There’s a growing demand for qualified analysts who can make sense of Big Data. With an MS in Data Analytics, you can become the data mining, management, mapping, and munging expert that today’s leading corporations desperately need.

vmaradaAuthor Commented:
horizontalScrollPolicy wasn't set. however, i dont want to show the horizontal scroll bar.
even i remove all the renderers also, the columns are resizing in the datagrid.
zzynxSoftware engineerCommented:
>> even i remove all the renderers also, the columns are resizing in the datagrid.
There must be something else in your program causing this. I've never heard of such behaviour be default.
vmaradaAuthor Commented:
There is no manipulation of widths anywhere in my program. i need the renderers also. how to overcome this?
zzynxSoftware engineerCommented:
>> There is no manipulation of widths anywhere in my program
Then it must be possible to write a small application - just containing two windows; one empty and one having a DataGrid - that demonstrates this behaviour.
vmaradaAuthor Commented:
Example is working fine. but i don't know why it is behaving like that in my application.
zzynxSoftware engineerCommented:
>> Example is working fine.
That's what I suspected

>> but i don't know why it is behaving like that in my application.
For me there's only one possibility to detect that: I need to see all your code. But I don't know if that is acceptable/feasable for you.
vmaradaAuthor Commented:
zzynxSoftware engineerCommented:
Thanx 4 axxepting
So you found why it behaved like that?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.