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 6131713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:00:39+00:00 2026-05-23T17:00:39+00:00

I have a AdvancedDataGrid, defined as: <mx:AdvancedDataGrid id=mainGrid width=200 height=200 designViewDataType=flat > <mx:columns> </mx:columns>

  • 0

I have a AdvancedDataGrid, defined as:

<mx:AdvancedDataGrid id="mainGrid" width="200" height="200" designViewDataType="flat" >
    <mx:columns>
    </mx:columns>
</mx:AdvancedDataGrid>

I am adding dynamically the columns to the grid, and the main question is:

  • How to setup an array or vector as dataprovider to each Column?

P.S.
this function I am using to fill up the data:

private function buildUpTheGrid() : void    {

    masterColumns = new Array();
    masterData    = new Array();

    var tempColumn : AdvancedDataGridColumn;


    for( var iY : int = 0; iY < columsCount; iY++ )                 
    {
        masterData.push( new Array() );
        tempColumn           = new AdvancedDataGridColumn();
        tempColumn.width     = 20;

        for( var iX : int = 0; iX < rowsCount; iX++ )
            masterData[ iY ].push( iX );

    //  tempColumn.dataField = ???
        masterColumns.push( tempColumn );
    }

    mainGrid.columns = masterColumns;
    mainGrid.validateNow();
}
  • 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-05-23T17:00:39+00:00Added an answer on May 23, 2026 at 5:00 pm

    Short answer to your question “How to setup an array or vector as dataprovider to each Column ?”: You cannot.

    The data ‘views’ in flex are all row based, not column based. So, for this to work, you’ll need to transform your columns into rows. It’s a fairly simple algorithm that I’m sure you can figure out.

    As for adding the columns dynamically, you just need to add the columns to an array and then set that array in the ‘columns’ property of the grid. You’ll need to set a ‘dataField’ property on the column for it to know which data property to display from the row data you’ve just transformed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this AdvancedDataGrid: <mx:AdvancedDataGrid id=grid height=384 width=100% styleName=aStyleName displayItemsExpanded=false groupItemRenderer=SomeRenderer draggableColumns=false defaultLeafIcon={null}
I have an AdvancedDataGrid. One of the columns in the grid displayed with help
I have a AdvancedDatagrid with two columns lets say. First column has item renderer
I have an AdvancedDataGrid being built dynamically from an html table. The html is
I have an AdvancedDataGrid with mx:HierarchicalData as DataProvider. I need the grid to bi
* Newbie Alert * I have an AdvancedDataGrid with 5 columns. The second column,
I have an AdvancedDataGrid that's pretty wide (lots of columns that need to be
I have an AdvancedDataGrid with a GroupingCollection and a SummaryRow. How do I display
I have an AdvancedDataGrid(ADG) bound to an ArrayCollection. ArrayCollection is populated from my Oracle
I have flex advancedDataGrid (could use dataGrid if that works better, though i like

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.