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

  • Home
  • SEARCH
  • 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 411065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:57:01+00:00 2026-05-12T17:57:01+00:00

I am trying display values in a datagrid in my application. I have all

  • 0

I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file, to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the code, i.e.,

<mx:Model id="reviewList" source="assets/reviewList.xml"/>
<mx:ArrayCollection id="reviewlist" source="{reviewList.Item}"/> 

I get an error, saying

Error No# 1034: Type coercion failed cannot convert mx.utils::ObjectProxy to Array.

But If I have two record sets in the XML file, it works fine. If there is only one set, I get the above said error? What is the problem in this case?

Here is my xml file:

<ReviewList>
<Item>
    <ReviewId>1123</ReviewId>
    <TaskType>User Requirement Specification</TaskType>
    <RequestId>1223</RequestId>
    <ItemCodeVersion>URS - 1</ItemCodeVersion>
    <ReviewStartDate>29-Sep-2009</ReviewStartDate>
    <Status>Review In Progress</Status>
    <Reviewer>MR.RISHU GHOSE</Reviewer>
    <OpenDefect>0</OpenDefect>
    <CasualAnalysisPending>0</CasualAnalysisPending>
    <CloseDefects>0</CloseDefects>
    <VerifiedDefects>0</VerifiedDefects>
</Item>

</ReviewList>

And this is the datagrid where I want the details to be displayed.

<mx:DataGrid id="reviewDG" dataProvider="{reviewlist}" variableRowHeight="true" width="100%" height="200" 
                     horizontalScrollPolicy="off">

<mx:columns>
    <mx:DataGridColumn headerText="Review Id" dataField="ReviewId" textAlign="center" />

    <mx:DataGridColumn headerText="Task Type" dataField="TaskType" textAlign="center"/> 

    <mx:DataGridColumn headerText="Request Id" dataField="RequestId" textAlign="center"/> 

    <mx:DataGridColumn headerText="Item Code-Ver" dataField="ItemCodeVersion" textAlign="center" headerWordWrap="true"/> 

    <mx:DataGridColumn headerText="Review Start Date" dataField="ReviewStartDate" textAlign="center" headerWordWrap="true"/>

    <mx:DataGridColumn headerText="Status" dataField="Status" textAlign="center"/>

    <mx:DataGridColumn headerText="Reviewer" dataField="Reviewer" textAlign="center"/>

    <mx:DataGridColumn headerText="Open Defect" dataField="OpenDefect" textAlign="center" headerWordWrap="true"/> 

    <mx:DataGridColumn headerText="Casual Analysis Pending" dataField="CasualAnalysisPending" textAlign="center" headerWordWrap="true"/>

    <mx:DataGridColumn headerText="Close Defects" dataField="CloseDefects" textAlign="center" headerWordWrap="true"/>

    <mx:DataGridColumn headerText="Verified Defects" dataField="VerifiedDefects" textAlign="center" headerWordWrap="true"/>

    <mx:DataGridColumn headerText="Review Details" dataField="ReviewDetails" width="65" headerWordWrap="true"> 
     <mx:itemRenderer> 
       <mx:Component> 
        <mx:Label text="View" click="outerDocument.onViewClick()"/> 
       </mx:Component> 
     </mx:itemRenderer> 
    </mx:DataGridColumn> 


</mx:columns>
  </mx:DataGrid>    

There may be cases in my application where i need only one record to be displayed in the datagrid. In such cases how do I resolve this error?

  • 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-12T17:57:01+00:00Added an answer on May 12, 2026 at 5:57 pm

    My understanding is that the <mx:Model> declaration should probably be instead. Honestly never used either, but from my reading here it seems that the mx:Model declaration turns the xml into an object (ObjectProxy). So based on your problem, I’m guessing that if it encounters a single “Item”, it turns that into a key:value pair (e.g., simple Object) within the proxy. When it encounters multiple “Item”s, it puts them into an Array instead. That is, the structure of the contents is likely unpredictable.

    So if you use mx:XML (with format=”e4x”),and use an XMLListCollection instead of ArrayCollection, you can use {reviewList.Item} as your source.

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

Sidebar

Ask A Question

Stats

  • Questions 254k
  • Answers 254k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the "IN" restriction, but supplement to ensure that the… May 13, 2026 at 10:04 am
  • Editorial Team
    Editorial Team added an answer You are not resetting your j var for the next… May 13, 2026 at 10:04 am
  • Editorial Team
    Editorial Team added an answer The disadvantage of allowing a column to be null impacts… May 13, 2026 at 10:04 am

Related Questions

We have an app that uses simple one way binding with a GridView to
I am just getting started with Linq, WPF and Silverlight. I am trying to
I am trying to populate a text box based on the values from a
I am trying to align some data in a c# struct that was created

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.