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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:25:10+00:00 2026-05-23T10:25:10+00:00

I have an AdvancedDataGrid being built dynamically from an html table. The html is

  • 0

I have an AdvancedDataGrid being built dynamically from an html table. The html is provided by a server so my code has to work dynamically for different columns/rows.

I have the columns being built and they display properly, however when I get to adding the rows is where i have issues. the follow code snippet shows iterating over all of the columns and adding a value under each of those columns to an object (to make a complete row) and then adding that to the ArrayCollection that later gets set to the dataProvider for the AdvancedDataGrid

//create an item to work with
var chartItem:Object = new Object();
for( var j:int = 0; j < columnResult.length ; j++ ) 
{
    //this is the data that goes under the column (headerArray)
    var item:String = removeformat(removetd(columnResult[j]));
    //grab the header (this is which column the value will be added
    var head:String = headerArray[j];
    //set the value to header (pair)
    chartItem[head] = item;
}
//add the chartItem (row) to the main collection
arr.addItem(chartItem);

my issue is that when “head” has a value of 0, as in the column title is ‘0’, the item is added at position [0] instead of at 0 as a string.

I looked up some examples and tried with:

chartItem.head but that just assumes the column title is ‘head’ instead of grabbing the value of the head var

  • 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-23T10:25:11+00:00Added an answer on May 23, 2026 at 10:25 am

    It is not possible to use numbers as an index in associative arrays.

    Most of the time the index in an associative array is just a variable name of an Object. That’s why you can access the data either with obj["someKey"] or obj.someKey. Of course you can use characters within your keys that are not allowed within variable names (like spaces, special symbols). However, you can access those only with brackets, not with dot (obj["foo/bar"] works, obj.foo/bar won’t work). So, this is not recommended…

    Well, back to your problem: I’d suggest you prefix all your column names with a character (e.g. use “_0”). Since you create the AdvancedDataGrid columns dynamically that shouldn’t be a problem. You can explicityl set the headerText of those columns in order to still show “0” in the column header instead of “_0”.

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

Sidebar

Related Questions

I have an AdvancedDataGrid(ADG) bound to an ArrayCollection. ArrayCollection is populated from my Oracle
I have an AdvancedDataGrid that has a couple AdvancedDataGridColumnGroup's I would like each group
have a table that dynamically generates text boxes in run time. I want to
I have an AdvancedDataGrid that loads data from a web service. It only loads
* 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
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I

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.