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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:37:38+00:00 2026-06-06T02:37:38+00:00

I am getting xml by webservice and want to display it to datagrid. But

  • 0

I am getting xml by webservice and want to display it to datagrid. But the columns are not coming in order to dataprovider. plese find xmldata below:

<Vendor name="Infosys Limited" adopTotal="120" totalstrength="775" FY10Q1="162" FY10Q2="132" FY10Q3="229" FY10Q4="254" FY11Q1="282" FY11Q2="243" FY11Q3="238" FY11Q4="233" FY12Q1="237" FY12Q2="136" FY12Q3="101" FY12Q4="120"/>
<Vendor name="Wipro" adopTotal="42" totalstrength="1181" FY10Q1="9" FY10Q2="12" FY10Q3="53" FY10Q4="67" FY11Q1="85" FY11Q2="76" FY11Q3="84" FY11Q4="82" FY12Q1="98" FY12Q2="51" FY12Q3="39" FY12Q4="42"/>
<Vendor name="Zensar Technologies Inc" adopTotal="187" totalstrength="1408" FY10Q1="207" FY10Q2="197" FY10Q3="428" FY10Q4="490" FY11Q1="511" FY11Q2="479" FY11Q3="471" FY11Q4="440" FY12Q1="440" FY12Q2="308" FY12Q3="137" FY12Q4="187"/>
<Vendor name="Hcl Technologies Limited" adopTotal="0" totalstrength="342" FY10Q1="0" FY10Q2="0" FY10Q3="0" FY10Q4="0" FY11Q1="3" FY11Q2="0" FY11Q3="9" FY11Q4="0" FY12Q1="0" FY12Q2="1" FY12Q3="1" FY12Q4="0"/>
<Vendor name="Mahindra Satyam" adopTotal="73" totalstrength="12" FY10Q1="106" FY10Q2="69" FY10Q3="50" FY10Q4="63" FY11Q1="117" FY11Q2="203" FY11Q3="192" FY11Q4="195" FY12Q1="208" FY12Q2="139" FY12Q3="53" FY12Q4="73"/>
<Vendor name="TCS" adopTotal="48" totalstrength="106" FY10Q1="54" FY10Q2="75" FY10Q3="140" FY10Q4="164" FY11Q1="164" FY11Q2="140" FY11Q3="147" FY11Q4="134" FY12Q1="124" FY12Q2="83" FY12Q3="49" FY12Q4="48"/>

In datagrid name attribute is coming at last. I can not keep in flex code because column count may increase. Please help.

Thanks
Rimi

  • 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-06T02:37:40+00:00Added an answer on June 6, 2026 at 2:37 am

    Please find below code:- this may give you some idea: –

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   >
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <fx:XML id="sampleXML" >
                <contacts>
                    <Vendor name="Infosys Limited" adopTotal="120" totalstrength="775" FY10Q1="162" FY10Q2="132" FY10Q3="229" FY10Q4="254" FY11Q1="282" FY11Q2="243" FY11Q3="238" FY11Q4="233" FY12Q1="237" FY12Q2="136" FY12Q3="101" FY12Q4="120"/>
                    <Vendor name="Wipro" adopTotal="42" totalstrength="1181" FY10Q1="9" FY10Q2="12" FY10Q3="53" FY10Q4="67" FY11Q1="85" FY11Q2="76" FY11Q3="84" FY11Q4="82" FY12Q1="98" FY12Q2="51" FY12Q3="39" FY12Q4="42"/>
                    <Vendor name="Zensar Technologies Inc" adopTotal="187" totalstrength="1408" FY10Q1="207" FY10Q2="197" FY10Q3="428" FY10Q4="490" FY11Q1="511" FY11Q2="479" FY11Q3="471" FY11Q4="440" FY12Q1="440" FY12Q2="308" FY12Q3="137" FY12Q4="187"/>
                    <Vendor name="Hcl Technologies Limited" adopTotal="0" totalstrength="342" FY10Q1="0" FY10Q2="0" FY10Q3="0" FY10Q4="0" FY11Q1="3" FY11Q2="0" FY11Q3="9" FY11Q4="0" FY12Q1="0" FY12Q2="1" FY12Q3="1" FY12Q4="0"/>
                    <Vendor name="Mahindra Satyam" adopTotal="73" totalstrength="12" FY10Q1="106" FY10Q2="69" FY10Q3="50" FY10Q4="63" FY11Q1="117" FY11Q2="203" FY11Q3="192" FY11Q4="195" FY12Q1="208" FY12Q2="139" FY12Q3="53" FY12Q4="73"/>
                    <Vendor name="TCS" adopTotal="48" totalstrength="106" FY10Q1="54" FY10Q2="75" FY10Q3="140" FY10Q4="164" FY11Q1="164" FY11Q2="140" FY11Q3="147" FY11Q4="134" FY12Q1="124" FY12Q2="83" FY12Q3="49" FY12Q4="48"/>
                </contacts>
            </fx:XML>
        </fx:Declarations>
    
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
                import mx.events.FlexEvent;
    
                private function createADGColumn():void
                {
                    var attributes:XMLList = sampleXML.Vendor[0].@*;
                    var length:int = attributes.length();
                    var columns:Array = myADG.columns;
                    for(var i:Number=0; i<length; i++)
                    {
                        var adgColumn:AdvancedDataGridColumn = new AdvancedDataGridColumn();
                        adgColumn.headerText = String(attributes[i].localName()).toLocaleUpperCase();
                        adgColumn.dataField = "@"+attributes[i].localName();
                        columns.push(adgColumn);
                        myADG.columns = columns;
                    } 
                    myADG.dataProvider = sampleXML.Vendor;
                }
    
            ]]>
        </fx:Script>
    
        <mx:AdvancedDataGrid id="myADG" x="50" y="50"
                             width="900" height="400" creationComplete="createADGColumn()"
                             variableRowHeight="true" />
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting data from xml webservice. The data is coming in: <![CDATA]> like
I want to parse xml webservice in my phonegap application but i don't have
I'm running ant and added the below to build.xml but I'm getting:\ build.xml:51: Element
Guys I am getting response from webservice api as xml based response now the
This question can be very simple but could not find the answer; I receive
I want to use jQuery function to fetch web service response but getting error
I am getting HTML response through web service and I want xml from web
Have url of webservice, kinda: https://test.com/abc Open in web browser:, getting error: <?xml version=1.0
I am getting response from web service in xml format and data are inside
I have an getting an xml response on this format <?xml version=\1.0\ encoding=\utf-8\?>\r\n <PlatformResponse

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.