I suspect the issue may be with the return type of the GetData method
in your remoting class. ( I havn't run your code so am guessing here
:)
Since you are using Flash remoting, have you tried using the ASObject
type to return back to Flex/Flash?
This is normally handled decently by Flex/Flash and lets you specify
typed object using the ASType poperty.
E.G.
.Net method
-------------------
public ASObject testASObjectCall ()
{
ASObject myObj = new ASObject();
myObj.ASType = "MyVO";
myObj.Add("label","myLabel");
myObj.Add("price",100.00);
return myObj;
}
Corresponding AS class
----------------------------------------
class MyVO extends Object {
public var label:String;
public var price:Number;
public static var registered:Boolean = Object.registerClass( "MyVO",
MyVO);
function MyVO (){
//super();
trace("$constructing MyVO");
}
public function toString():String{
return ( "price=" + this.price +", label=" + this.label);
}
}
HTH
superabe
> >
> > .NET Class
> >
> >
> >
> >
> >
> > using System;
> > using FlashGateway.IO;
> > using System.Xml;
> > using System.Data;
> > using System.Data.SqlClient;
> > using System.IO;
> > using System.Text;
> > using System.Collections;
> >
> >
> >
> > namespace RemoteTest
> > {
> > public class Sample
> > {
> > public object[] GetData()
> > {
> >
> > ArrayList list = new ArrayList();
> > list.Add("string1");
> > list.Add("string2");
> > list.Add("string3");
> > list.Add("string4");
> > return list.ToArray();
> > }
> > }
> > }
> >
> > <?xml version="1.0" encoding="utf-8"?>
> >
> >
> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
> > backgroundColor="#FFFFFF"
> > initialize="initApp()">
> >
> >
> > <mx:Script>
> >
> > var arrTest:Array;
> > function initApp() {
> >
> >
> > getArray();
> > }
> >
> >
> > function getArray() {
> > arrTest = srv.GetData();
> >
> >
> > }
> >
> >
> > </mx:Script>
> >
> >
> > <mx:RemoteObject id="srv" source="RemoteTest.Sample">
> > <mx:method name="GetData"/>
> > </mx:RemoteObject>
> >
> >
> > <mx:Form>
> > <mx:FormItem>
> >
> >
> > <mx:DataGrid id="dg" width="100%" height="100%"
> dataProvider="{arrTest}">
> > </mx:DataGrid>
> > </mx:FormItem>
> > </mx:Form>
> >
> >
> > </mx:Application>
> >
> > Sreejith Unnikrishnan <[EMAIL PROTECTED]> wrote:
> >
> >
> > Priya, you should add as much details you can, preferably with
> pieces of
> > code that you are willing to share (to help understand problem
> better)
> > when you ask a question.
> >
> > Because the short answer to your question is NO.
> > You are doing fine. That is indeed how you bind a result to a
> datagrid.
> >
> > A better answer would need better detailed question.
> >
> > Regards
> > Sree
> >
> > priya s wrote:
> >
> > > no i m not using web services. I am just making a call to a .NET
> assembly.
> > >
> > > */Clint Modien <[EMAIL PROTECTED]>/* wrote:
> > >
> > > Are you using webservices?
> > >
> > > On 7/28/05, *priya_uvce* <[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]>> wrote:
> > >
> > > Hi all,
> > > I want to return an object array from .NET to Flex,
> and bind the
> > > datagrid with the same.
> > > I have created an Array variable in ActionScript which
> will
> > > recieve the
> > > object array from .NET.
> > > I bind this array variable to the DataGrid.
> > > The array I am returning is an array of objects of say
> an Employee
> > > class which I have created. This Employee class is
> Serializable.
> > > Am I missing out something?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> > >
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives:
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > Yahoo! Groups Links
> > >
> > > <http://groups.yahoo.com/group/flexcoders/>
> > >
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > SPONSORED LINKS
> > > Computer software testing
> > > <http://groups.yahoo.com/gads?
> t=ms&k=Computer+software+testing&w1=Computer+software+testing&w2=Macr
> omedia+flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=kh2Cgu
> JwmatU5oBXjFo9Rg>
> > > Macromedia flex
> > > <http://groups.yahoo.com/gads?
> t=ms&k=Macromedia+flex&w1=Computer+software+testing&w2=Macromedia+fle
> x&w3=Development&w4=Software+developer&c=4&s=93&.sig=dAUcEV7do91-
> wrRtVS641g>
> > > Development
> > > <http://groups.yahoo.com/gads?
> t=ms&k=Development&w1=Computer+software+testing&w2=Macromedia+flex&w3
> =Development&w4=Software+developer&c=4&s=93&.sig=AlxNUQBOI7Io7S7nhmxV
> 0Q>
> > >
> > > Software developer
> > > <http://groups.yahoo.com/gads?
> t=ms&k=Software+developer&w1=Computer+software+testing&w2=Macromedia+
> flex&w3=Development&w4=Software+developer&c=4&s=93&.sig=QWIit8JayomoI
> HLVkV3FDg>
> > >
> > >
> > > -----------------------------------------------------------------
> -------
> > > Start your day with Yahoo! - make it your home page
> > > <http://us.rd.yahoo.com/evt=34442/*http://www.yahoo.com/r/hs>
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives: http://www.mail-archive.com/flexcoders%
> 40yahoogroups.com
> > >
> > >
> > > -----------------------------------------------------------------
> -------
> > > YAHOO! GROUPS LINKS
> > >
> > > * Visit your group "flexcoders
> > > <http://groups.yahoo.com/group/flexcoders>" on the web.
> > >
> > > * To unsubscribe from this group, send an email to:
> > > [EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]
> subject=Unsubscribe>
> > >
> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms
> of
> > > Service <http://docs.yahoo.com/info/terms/>.
> > >
> > >
> > > -----------------------------------------------------------------
> -------
> > >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
> 40yahoogroups.com
> >
> >
> >
> >
> > ---------------------------------
> > YAHOO! GROUPS LINKS
> >
> >
> > Visit your group "flexcoders" on the web.
> >
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
> >
> >
> > ---------------------------------
> >
> >
> >
> >
> >
> >
> > ---------------------------------
> > Start your day with Yahoo! - make it your home page
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12h4v80ai/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122661824/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/