none
Bind custom control with multiple xmlnodes (same names) RRS feed

  • Question

  • I am able to bind the data of one xml node to a custom control, using XPath en Tag. Now I want to bind multiple xmlnodes (same names) with the same custom control. It seems to be that my binding is only taking the first:

    ex:

    <personaldetails>
    <attest>attest 1</attest>
    <attest>attest 2</attest>
    <attest>attest 3</attest>
    </personaldetails>

    In Word the custom control Tag: personalDetails/attest  => returns only attest 1, but i want to return attest 1, attest 2 and attest 3 in my custom control

    If I use the Tag: personalDetails/attest[2] => it returns attest 2 (as it should be)

    So the binding is working, I'm only searching for a solution how I can get multiple values into one custom control

    Binding method I use:

    DataBinding binding = new DataBinding();
    binding.XPath = tagContentControl.GetFirstChild<SdtProperties>().GetFirstChild<Tag>().GetAttribute("val", "http://schemas.openxmlformats.org/wordprocessingml/2006/main").Value;
                                    tagContentControl.GetFirstChild<SdtProperties>().Append(binding);

    Tnx,

    Jeroen


    • Edited by JeroenVanOlmen Thursday, February 23, 2012 1:33 PM binding code added
    Thursday, February 23, 2012 1:14 PM