Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8346245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:56:48+00:00 2026-06-09T06:56:48+00:00

I am having serious problems trying to resize columns in a DataGrid. I’ve been

  • 0

I am having serious problems trying to resize columns in a DataGrid. I’ve been at it for over a day now and am at my wit’s end with a headache to boot.

Essentially, I have a TabNavigator component with NavigatorContent children inside. In each one of the NavigatorContent children, I have a DataGrid to which I’m setting the width to 100% (this is needed to be able to handle resizing of the browser window). I am using the excellent filterable DataGrid from Iwo Banas as the DataGrid in each tab.

Now, I am making visible/invisible some columns in each of the DataGrids and this is working fine. However, I find that the column widths are not being set correctly. Whenever I set the column widths (using this code), all of the columns seem to be set to the correct width except for the ones that I have recently made visible and the column immediately to the left of these. The ones recently made visible are very small (though I set their width to 30) and the one to the left of these columns is very large (though I’ve also set its width to 30).

I think it’s something to do with the life cycle of the DataGrids because the first DataGrid behaves fine. It’s when I click on the other tabs that I find that the widths of the other DataGrids have not been set correctly.

However, if I “see” one of those problem DataGrids (i.e. it appears on the screen) and the code which resizes the columns runs again, the columns are correctly sized.

I have tried a number of things recommended all over the internet including the questions listed below but to no avail.

This is the code I’m using to resize the columns (taken from this answer)

public static function resizeColumn(col:DataGridColumn, size:int):void
        {
                var owner:* = col.mx_internal::owner
                col.mx_internal::owner = null;

                col.width = size;

                col.mx_internal::owner = owner;
        }

Any and all help would be greatly appreciated.

I have already looked at the following answers.
Flex DataGrid column width: one column to rule them all?
Flex 3 DataGrid Column Width Problem
Flex DataGrid Column Width (<– this answer got me closest)
Unable to change the column width dynamically in flex datagrid

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:56:53+00:00Added an answer on June 9, 2026 at 6:56 am

    So, after a huge amount of head wrecking, I finally found a solution (at least to my problem, not sure if it would help anyone else but thought I’d post it here anyway as you never know what could help someone else).

    I decided that since calling the resize code when the DataGrid is on screen works then I needed to just do that. So I thought of putting the resize code for the relevant DataGrid depending on the tab clicked. Not that straightforward as there didn’t seem to be a straightforward way to implement a click handler for the tabs. I did a quick Google and found this solution.

    Essentially, you add a click handler for each tab button by cycling through the children of the tab navigator, getting the button and adding an event listener.

    Then, you do what you need to do in the handler.

    Code example (slightly different to one from website):

            protected function tbGridArea_creationCompleteHandler(event:FlexEvent):void
            {
                for ( var i:int=0; i < tbGridArea.getChildren().length; i++ )
                {
                    var tab:Object = tbGridArea.getTabAt(i);
                    tab.addEventListener( FlexEvent.BUTTON_DOWN,myTabClickHandler );
                }
            }
    
            private function myTabClickHandler(event:Event):void {
                switch(event.currentTarget.label) {
                // do whatever you need to do here
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having serious problems in how to update the record that has just been
I'm having some serious problems with the PHP Data Object functions. I'm trying to
I'm trying to add HTML inside an element but I'm having serious problems escaping
I am having serious trouble with trying to get all the forms on a
I am having some serious issues trying to tweak my layout in a table.
I'm having serious problems with accepting payments. I'm passing the total amount in a
Good Day, I have been trying various methods both found on here and in
I'm having serious problems with creating a Web service in Visual Studio 2010 (Framework
I am having serious problems with the SoundHound application , from my HTC Desire
I'm currently trying to parse a document with DOMDocument, and I'm having some serious

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.