Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Binding Field to lower elements in XML
posted


How do I bind a Field to a lower XPath element that the default? For instance, I have XML with a structure similar to this

<Family>
  <Persons>
    <Person>
      <FirstName>Bob</FirstName>
      <LastName>Smith</LastName>
      <Friends>
        <Friend>
           <FriendName>Ralph</FriendName>
           <FriendAge>22</FriendAge>
        </Friend>
      </Friends>
    </Person
   .etc
   .etc
 </Persons>
</Family>

In the XAML, I have a DataProvider, e.g.
<XmlDataProvider x:Key="FamilyData" XPath="/Family" Source="Family.xml"/>

and a grid bound to it, e.g.
<igDP:XamDataGrid x:Name="_xamDataGrid" DataSource="{Binding Source={StaticResource FamilyData}, XPath=//Person}">

Fields are defined, e.g.
<igDP:Field Name="FirstName" Label="First Name"/>
<igDP:Field Name="LastName" Label="Last Name"/>
<igDP:Field Name="???" Label="Friend"/>

I want the third Field bound to the relative XPath Friends/Friend/FriendName. How do I do this?

Thanks.
Greg

Parents Reply Children