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
2589
List of arrays as data source in XamWebGrid?
posted

Hello,

Is that possible to use list of arrays as datasource for WebGrid? It could be an array of value types or typed array 

For example:

class Person { 

int ID { get; set;}

string Name { get; set; }

}

List<object[]> list = new List<object[]>

list.Add( new object[] { 1, new Person() });

 

and then grid binds columns to array by index and not to property. For example, it would bind 1st column to object[0], 2nd column to object[1].Name and so on.

I compose a grid at runtime and I don't know how many columns I would have. I tried to make new types with System.Reflection but this consumes too many resources.

Thank you.

Parents Reply Children
No Data