Invalid cast!

A

Adam Knight

Hi all,

I am using the following code to specify datasource for a datagrid:
<bma:subAreasGrid id="subAreasGrid" runat="server" Data='<%#
Container.DataItem.Row.GetChildRows("relSubAreas")%>'></bma:subAreasGrid>

When the Data property of the user control recieves the data object it
recieves it as a 'Object'
I am trying to cast it to a useable format for binding it to the datagrids
datasource.

I have tried casting it to datarow, data row collection but none have
worked.

Can anyone tell me where i am going wrong?

Still learning the ropes here, so any help is appreciated.
 
K

Karl Seguin

Well, you can debug your code, add a breakpoint and a watch to the object
and the debugger should tell you what type it really is.

My guess is that it's a DataRowView or DataView (probably DataRowView)

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top