# How to bind select XML Elements to Gridview

**URL:** <https://forum.kirupa.com/t/how-to-bind-select-xml-elements-to-gridview/272029>\
**Category:** programming\
**Created:** [October 1, 2008, 1:56pm UTC](https://forum.kirupa.com/t/how-to-bind-select-xml-elements-to-gridview/272029 "2008-10-01T13:56:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zuzia](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@Zuzia](https://forum.kirupa.com/u/Zuzia)\
**Post date:** [October 1, 2008, 1:56pm UTC](https://forum.kirupa.com/t/how-to-bind-select-xml-elements-to-gridview/272029/1 "2008-10-01T13:56:24Z")

</div>

Hello,

I was reading the article on how to retreive elements from an XML file and display them to the user. The Kitupa article is: [http://www.kirupa.com/net/readingXML\_pg3.htm](http://www.kirupa.com/net/readingXML_pg3.htm) .

In my case I am able to get as far, except that I am stuck at the point where I need to be able to bind select elements’ contents to a gridview.

For example if I have an XML file that contains 5 elements, I want to take out only 2 and bind those 2 to a gridview. Is there a way to do that? What is the best way? Could you show me a code snippet?

Thank you,  
Zuzia
