ObjectDataSource non-primitive data fields

  • Thread starter Thread starter DoesDotNet
  • Start date Start date
D

DoesDotNet

HI All

I have a class called program with a class called Investor as one of
its Properties.

Now, I wish I could do this:
<asp:BoundField DataField="Investor.Name" HeaderText="Investor"
SortExpression="Investor.Name" />

but it won't let me...

A field or property with the name 'Investor.Name' was not found on the
selected data source.

What's the common way to do this?
Thank you in advance
 
The ObjectDataSource needs to map those directly to a parameter to the method
or to a property on the object type. So in short, it doesn't support that
style. You could write a InvestorName property on the class which in turn
sets the Investor.Name.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Thank you very much for your answer.
This is a clever approach and I will use it.
Thanks again.
 

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

Back
Top