views:

287

answers:

2

Hi,

I have a basic test web form with a DataList and a DetailsView and two XmlDataSource components for each of them.

The binding of the DataList to the underlying XML document was easy to set up, but I'm struggling with getting the DetailsView hooked up. The idea is that there is a master/details relationship between the two bindable controls, so I guess I should hook onto the OnSelectedItemIndexChanged on the DataList to do the binding of the currently selected item in the DetailsView. But what is the correlating key / how do I set a DataKeyField when I use a XmlDataSource to get this to work?

cheers,

--larsw

A: 

Wow! I'm doing exactly that right now but using Object Data Source :)

I am following a great tutorial on that from Matt Berseth, check his post.

It will be almost the same, the only thing is that you use other DataSource, but the rest is the same!

balexandre
Hi, Doing it with ObjectDataSource is easy enough - but you can't do it the same way with XmlDataSource :-/
larsw
He's using ODS but his loading a XML document, try that! Download the code and see for your self, all data comes from an XML.
balexandre