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
170
Dynamic Columns on a binded grid
posted

Hi, It's possible to dynamic add columns based on list property of a source?

I'm binding the grid with List<Person>:

public class Person
{
    public int ID { get; set; }
    public List<Purchase>  PurchasesHistory { get; set; }

public class Purchase
{
    public string Product { get; set; }
}

The result i'm trying to get, it's a grid with a first column showing person's ID, and then 'n' columns showing each 'Purchase' object contained in 'PurchasesHistory'.

'PurchasesHistory' list has the same number of items for each 'Person'.

What you think? Is it possible?

Thanks in advance...