Rank: Advanced Member Groups: Member
Joined: 5/22/2009 Posts: 33
|
Hello Sir,
I would like to bind a xml file into Grid control. How can I do it? My structure of Xml data is like:
<FunctionList> <FunctionInfo> <Id>1</Id> <Name>Test 1</Name> <\FunctionInfo> <FunctionInfo> <Id>2</Id> <Name>Test 2</Name> <\FunctionInfo> <FunctionInfo> <Id>3</Id> <Name>Test 3</Name> <\FunctionInfo> <\FunctionList>
Can I bind this xml file to a Grid control and display 2 columns for Id and Name? Thank you for your help.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can not do that because Grid is two demensional and an Xml file is hierarchical. We will add the ability to directly bind to an XmlDataSource in our next build, however it will only work with attributes, not child element. For example, the following XML will work:
Code: HTML/ASPX
<FunctionInfo Id="1" Name="Test 1">
</FunctionInfo>
But this will not work:
Code: HTML/ASPX
<FunctionInfo>
<Id>1</Id>
<Name>Test 1</Name>
</FunctionInfo>
Thanks
|