Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Binding to multiple business objects
posted

Is there a way to bind to multiple business objects so that columns in my grid are pulling from different sources? 

For example if I have an Order class and a Customer class, and I want to display the customer names along with the orders, can I do that using the two different business objects?  I also want these to appear in the same band. 

 Thanks for the help!

Parents
No Data
Reply
  • 375
    posted

    Hi,

    maybe this will help. Add a property Customer to the Order object. This property has to be the type of the customer object. Add the related cutomer object to the property of the order object. Extend the customer object and add the following code:

    public override string ToString()

    {

    return this.Name; // change this to the property you want

    }

    If you add the order list as datasource to the grid a column will be added that will be showing the returned string out of the ToString method.

    Hope this will help.

    Kind regards,

    Ralf

Children
No Data