When a single item comes back Flex converts it to an Object rather than
an ArrayCollection.
Do something like:
//where arrTable is the model (ArrayCollection) you are setting
if (!(event.result.diffgram.NewDaraSet.Table is ArrayCollection))
{
arrTable = new ArrayCollection();
arrTable.addItem(event.result.diffgram.NewDaraSet.Table);
}
else
{
arrTable = event.result.diffgram.NewDaraSet.Table;
}
HTH
Steve
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of subeesh a
Sent: 08 March 2007 10:40
To: [email protected]
Subject: [flexcoders] .NET web service and Data Grid
Hi All,
I am using a .NET web service to populate datagrid. I am converting the
result of the web service call to arraycollection and bind it to the
datagrid.
The issue is that when there is only one data in the database, the data
grid is not showing up anything.
I have analyzed the event tree of the web service call.In the case of
more than one record, the event object is like
event.result.diffgram.NewDaraSet.Table[0]..
event.result.diffgram.NewDaraSet.Table[1]..
event.result.diffgram.NewDaraSet.Table[0]..
in the case of database with only one record, the event object is like
event.result.diffgram.NewDaraSet.Table
How can i bind the data to the datagrid in this case
Thanks Subeesh
_____
Here's a new way to find what you're looking for - Yahoo!
<http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/>
Answers