This is a migrated thread and some comments may be shown as answers.

ObjectDataSource Report Binding

1 Answer 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 26 Feb 2011, 07:19 PM
I am having some difficulty figuring out how to get a Report to bind to my business objects.

I am using Interfaces in the following way:

public interface ITopInterface
    {
         
        string A { get; }
}
 
public interface IBottomInterface: ITopInterface
    {
        string B { get; }
       bool C { get; }
}

In my implementation I end up with something like to following:
public class BaseClass : ITopInterface
{
    public string A { get { return "test"; } }
}
 
 
public class newobject : BaseClass, IBottomInterface
{
   public string B { get { return "test"; } }
  public bool C { get { return true; } }
}

So, when I am create the object data source, I am binding to a collection of "IBottomInterface", however, only the properties of that
(
IBottomInterface) seem to be  visible and usable to the report? Anyway, I
was thinking that all of the properties of both interfaces 

would be there, as IBottomInterface is a ITopInterface..? Is there
a way to force the object data source to see the entire object?

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Mar 2011, 04:16 PM
Hi Kurt,

We have performed a test locally with the provided code snippets and we have successfully bound to the newobject that exposes the ITopInterface and IBottomInterface interface properties. Check out the attached class library.

All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Kurt
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or