This is a migrated thread and some comments may be shown as answers.

Hierarchical XML

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 14 Aug 2012, 04:47 PM
Hello,
I have a xml  from Webservice and i must show this in a GridView. This is a part from the XML result from Webservice:
<?xml version="1.0" encoding="utf-16"?>
<PlayerTree>
  <Main ID="1" Name="Göttingen - Halle">
    <Station ID="2" Name="Arenshausen">
      <Player ID="3" Name="Arenshausen 1" Group="Best Route" />
      <Player ID="4" Name="Arenshausen 2" Group="Best Route" />
      <Player ID="74" Name="Arenshausen 3" Group="Best Route" />
      <Player ID="89" Name="Arenshausen 4" Group="OIS" />
      <Player ID="90" Name="Test 1a" Group="Best Route" />
      <Player ID="91" Name="Richtung Süd" Group="Best Route" />
      <Player ID="92" Name="Neu" Group="Best Route" />
      <Player ID="99" Name="Neuer Test" Group="Best Route" />
      <Player ID="100" Name="Neuer Player" Group="Best Route" />
      <Player ID="101" Name="Arenshausen 5" Group="Best Route" />
    </Station>
    <Station ID="5" Name="Heilbad Heiligenstadt">
      <Player ID="6" Name="Hig 1a" Group="Best Route" />
      <Player ID="7" Name="Hig 2" Group="Best Route" />
      <Player ID="8" Name="Hig 3" Group="Best Route" />
      <Player ID="9" Name="Hig 4" Group="Best Route" />
    </Station>
    <Sub ID="71" Name="Arenshausen - Uder" />
  </Main>
  <Main ID="10" Name="Hamburg - Hannover">
    <Station ID="60" Name="Station A" />
    <Station ID="61" Name="Station B" />
  </Main>
  <Main ID="17" Name="Erfurt Leinefelde - Erfurt">
    <Sub ID="30" Name="Route A2">
      <Sub ID="31" Name="Route A1 A2ab" />
    </Sub>
  </Main>
  <Main ID="18" Name="Teststrecke">
    <Sub ID="33" Name="Route A">
      <Station ID="95" Name="Teststation 1">
        <Player ID="96" Name="Unten" Group="Best Route" />
      </Station>
    </Sub>
  </Main>
  <Main ID="19" Name="Leinefelde - Heiligenstadt" />
  <Main ID="20" Name="Heiligenstadt - Nordhausen" />
  <Main ID="21" Name="Nordhausen - Heiligenstadt" />
  <Main ID="22" Name="Nordhausen - Leinefelde">
    <Sub ID="35" Name="A1">
      <Sub ID="36" Name="A11">
        <Station ID="42" Name="Station A" />
        <Station ID="43" Name="Station B" />
        <Station ID="44" Name="Station C" />
        <Station ID="45" Name="Station D" />
      </Sub>
    </Sub>
  </Main>
  <Main ID="23" Name="Leinefelde - Nordhausen">
    <Sub ID="84" Name="Tr">
      <Station ID="85" Name="St">
        <Player ID="86" Name="Pl" Group="Best Route" />
      </Station>
    </Sub>
  </Main>
  <Main ID="24" Name="Route A">
    <Station ID="65" Name="Station A" />
  </Main>
  <Main ID="25" Name="Route B">
    <Station ID="66" Name="Station A1" />
  </Main>
  <Main ID="26" Name="Route C" />
  <Main ID="27" Name="Route D" />
  <Main ID="28" Name="Route E">
    <Sub ID="68" Name="TR">
      <Station ID="69" Name="ST">
        <Player ID="87" Name="Pl" Group="Best Route" />
        <Player ID="88" Name="Pl2" Group="Best Route" />
      </Station>
    </Sub>
  </Main>
  <Main ID="32" Name="Halle - Göttingen" />
  <Main ID="70" Name="Test" />
  <Main ID="77" Name="Hig2" />
  <Main ID="78" Name="Hig 3">
    <Sub ID="79" Name="Tr 1">
      <Station ID="81" Name="Station 1">
        <Player ID="82" Name="Player 1" Group="Best Route" />
        <Player ID="83" Name="Player 2" Group="Best Route" />
      </Station>
    </Sub>
    <Sub ID="80" Name="Tr 2" />
  </Main>
  <Main ID="102" Name="Testlauf">
    <Sub ID="103" Name="Teilroute">
      <Station ID="104" Name="Station">
        <Player ID="105" Name="Testplayer 1" Group="Best Route" />
      </Station>
    </Sub>
  </Main>
</PlayerTree>

How can I schow hierarchical (group)  this in my RadGridView? Is this possible?

BR
Reiner

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 17 Aug 2012, 10:09 AM
Hi Mario,

Thank you for writing.

Please refer to the following help article which explains how to bind RadGridView to an XML - Creating hierarchy using an XML data source.

I hope this will be useful. Should you have further questions, I would be glad to assist.

All the best,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Mario
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or