Inherited Properties for a value object not bindable in a datagrid

G

Guest

I have what I'm hoping doesn't turn into a very big problem.
We have a set of value objects which all inherit from a base value object
which contains functionality common to all of the objects. We have
implemented some custom DataSourceObjects which return lists of these value
objects.

The problem I'm running into is I can't bind to any of the common properties
of the ancestor object. Nor can I even eval against them. Is there someway
to reference the inherited properties of my value object in an Eval()
statement? I tried Eval("base.valueState") and Eval("valueState") but always
get the same error that the member doesn't exist.

I hope someone has had experience with this, it would be difficult to
refactor these value objects.

Thanks,
Matt Bell
 
G

Guest

Sorry I misspoke. They are DataSourceControl objects not DataSourceObjects if
that was confusing.
 
G

Guest

I knew as soon as I posted this I'd figure it out. The problem is that the
type needs to be exposed as a property. I think it has something to do with
how .net does reflection. So if your base object contains a type that you
want to bind to in a data grid, make sure it's got a property wrapping it.
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top