简体   繁体   中英

c# bind 2 lists to repeater

[c# linq]

i have 2 datasources, 1 coming from an xml document and 1 coming from an sql server database, both return an IEnumerable<EventsDetails> is it possible to bind both of these lists to a single repeater?

You're probably looking for something like this, if you want to use LINQ:

var both= list1.Union(list2);

Then both is your data source.

Create a new list containing both. Or an object implementing IEnumetator which first returns elements from the first, then from the second list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM