Solved

How to make the AdvancedDataGrid column widths are consistent in flex

Posted on 2009-06-30
11
1,845 Views
Last Modified: 2012-05-07
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.
<columns>

        <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"/>

   </columns>

    <rendererProviders>

        <mx:AdvancedDataGridRendererProvider column="{listNameCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridGroupRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{template}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{typeCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{versionCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>        

        <mx:AdvancedDataGridRendererProvider column="{categoryCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{previewCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.PreviewRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{hostStatusCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{urlCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.WebURLRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{createdOnCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.DateRenderer"/>

        <mx:AdvancedDataGridRendererProvider column="{lastUsedCol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.DateRenderer"/>

         <mx:AdvancedDataGridRendererProvider column="{timesUsedol}"

            renderer="com.zetainteractive.view.Renderers.Datagrid.ZetaAdvancedDataGridRenderer"/>

    </rendererProviders>

Open in new window

0
Comment
Question by:vmarada
  • 6
  • 5
11 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 24751939
>> 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?
0
 

Author Comment

by:vmarada
ID: 24760766
I mean, when i navigate from any screen to Datagrid screen, i observed that the width of the columns are changed.
screenshots.JPG
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24761048
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.
0
 

Author Comment

by:vmarada
ID: 24761763
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.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24762204
>> even i remove all the renderers also, the columns are resizing in the datagrid.
Seriously?
There must be something else in your program causing this. I've never heard of such behaviour be default.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:vmarada
ID: 24765415
There is no manipulation of widths anywhere in my program. i need the renderers also. how to overcome this?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24770395
>> 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.
0
 

Author Comment

by:vmarada
ID: 24785693
Example is working fine. but i don't know why it is behaving like that in my application.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24793172
>> 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.
0
 

Author Closing Comment

by:vmarada
ID: 31598379
ok
0
 
LVL 37

Expert Comment

by:zzynx
ID: 25738426
Thanx 4 axxepting
So you found why it behaved like that?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now