Click here to Skip to main content
15,397,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to bind 2 datasources from xml data to the same repeater. the second one always overwrite the first one. The binding works without any errors but it doesnt do it for both datasources, only the second one. Below is snippet of the code that does the binding. Is there a way to join the datasources and just do the binding once?. i cant use Arrays as the datasource type is
IEnumerable
.
I can attach the code if required

What I have tried:

<pre>Dim doc As New XmlDocument() 

Code that gets the data from the XML1 API....

Dim dataSource1 As  IEnumerable

rpMyRepeater.Datasource = datasource1
rpMyRepeater.Databind()




Dim doc1 As New XmlDocument()

Dim dataSource2 As  IEnumerable

Code that get the data from the XML2 API....

<pre>rpMyRepeater.Datasource = datasource2

rpMyRepeater.Databind()
Posted
Updated 25-Dec-19 4:56am

1 solution

You need to combine both XML documents into a single one:
What is the fastest way to combine two xml files into one[^]
   
Comments
hm9 25-Dec-19 11:39am
   
The issue is the files could be different format. I am trying to find a way to append the results of both datasources together into one and then bind the repeater to it something like below but need something to work:

datasource3 = datasource1 + datasource2
rpMyRepeater.Datasource = datasource3
phil.o 25-Dec-19 12:30pm
   
You will have to find a common layout for your files anyway, if you want the repeater to be able to display their contents.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900