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
315
Using UltraDataSource on collections of objects
posted

I have a snippet of sandbox code I'm trying to make work:

*************************** 

 

 

List<Foo> foos = new List<Foo>();

foos.Add(new Foo(1, 1));

foos.Add(

 

new Foo(2, 2));  

//What's the best way to get my Foo objects into the ultraDataSource?

ultraGrid1.DataSource = ultraDataSource1;

************************

I know I can manually add rows to the ultraDataSource but that would require iterating over the collection. Is that the only way to add to an UltraDataSource?

To back up a bit... the larger problem I'm simulating in my sandbox is that Foo has two properties, X and Y. I want a grid with ONLY ONE column, X. I'm assuming that the UltraDataSource is the way to go here. Is that assumption wrong. Should I skin this cat another way?

 [Edit: My code got a little chomped somehow, I just made it readable]

Parents Reply Children
No Data