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

Display Business object containing list of another business objects

1 Answer 39 Views
ListView
This is a migrated thread and some comments may be shown as answers.
RDot
Top achievements
Rank 1
RDot asked on 06 Oct 2011, 06:59 PM
Hi -

 I'm binding my ListView to a class that contains a list which is a list of another class.
 
For instance,  

public class Person
{
  public List<Orders> Orders {get; set;}
}
 
public class Orders
{
   public Guid Id {get; set;}
   public string {get; set;}
}

When I bind the ListView to an instance of the person class,  how could i display specific value for one of the orders on the row that displays for the person class?

Thanks -

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 10 Oct 2011, 08:35 AM
Hi Rob,

Thank you for contacting us.

I am not sure I understand correctly your scenario, but as far as I can see, you need to bind the RadListView to the Orders collection of your Person class and display either the Id or the string property (which has not been given a name). To do this, you can use the following code:
Person person = new Person();
//populate person with data
 
this.radListView.DataSource = person.Orders;
this.radListView.DisplayMember = "Id";

In case I have not understood you correctly, I would kindly ask you to provide me with a more detailed explanation of your scenario and your requirements. You can also send me a sample project which demonstrates them. This will let me investigate your case in detail and provide you with adequate support.

I hope this is useful. Should you have further questions, do not hesitate to write back.

Greetings,
Ivan Todorov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ListView
Asked by
RDot
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or