Welcome Guest Search | Active Topics | Sign In | Register

Any example to bind xml data to Grid control? Options
Jack.Wu
Posted: Wednesday, May 5, 2010 12:50:52 AM
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.
eo_support
Posted: Wednesday, May 5, 2010 9:30:26 AM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.