Your DataGridColumns need to specify a dataField property to determine which field in the XML object to display as the text for that cell.  If you need to customize the text beyond just pulling out a field from the XML, you can use a labelFunction to do so. I believe the ASDoc example for DataGrid shows how to use an XML object as the dataProvider.

 

http://livedocs.macromedia.com/flex/2/langref/index.html

 

Navigate to the DataGrid control and scroll down to the example.

 

-deepa

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sathish_nayak_b
Sent: Thursday, September 14, 2006 10:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to display XML object in DataGrid

 

In my Application i want to read XML file dinamically and display the
contents in Datagrid .
i used Following Code.

function loadXmlFile():void{
var request:URLRequest = new URLRequest("temp.xml");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
try {
loader.load(request);
} catch (error:ArgumentError) {
trace("An ArgumentError has occurred.");
} catch (error:SecurityError) {
trace("A SecurityError has occurred.");
}
}

private function completeHandler(event:Event):void {
dataXML:XML = XML(event.target.data);
myGrid.dataProvider=dataXML;

}

I getting XML object(dataXML) but i dont know how to display it to
Datagrid.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to