problem while binding repeater control with xml file programitically - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

problem while binding repeater control with xml file programitically

Last post 08-29-2011 11:04 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-26-2011 08:52 PM

    problem while binding repeater control with xml file programitically

    hi,

    i am binding the repeater control using xml file data programitically.

    while binding the data my next element data is also shwoing in the prevoius row.

     

    quoteCart = @"<?xml version=""1.0""?>

    <!-- comment at the root level -->

    <Products>

    <Product Title='1ms Ultra Inert'>

    <PartNumber>

    <Title>Ramesh</Title>

    <PartNo>122-0112UI</PartNo>

    <Description>DB-1ms Ultra Inert, 15 m, 0.25 mm, 0.25 m</Description>

    <Url>http://</Url>

    </PartNumber>

    <PartNumber>

    <Title>19091S-911UI</Title>

    <PartNo>19091S-911UI</PartNo>

    <Description>HP-1ms Ultra Inert, 15 m, 0.32 mm, 0.25 m</Description>

    <Url>http://</Url>

    </PartNumber>

    </Product>

    <Product Title='DB-35ms Ultra Inert'>

    <PartNumber>

    <Title>devendra</Title>

    <PartNo>122-3812UI</PartNo>

    <Description>DB-35ms, Ultra Inert, 15 m, 0.25 mm, 0.25 m</Description>

    <Url>http://</Url>

    </PartNumber>

    </Product>

    </Products>"
    ;

    FormState["QuoteCart"] = quoteCart;

    if (FormState["QuoteCart"] != null)

    {

    XDocument xmlDoc = XDocument.Parse(Convert.ToString(FormState["QuoteCart"]));

    // XmlDocument myDoc = new XmlDocument();

    //myDoc.LoadXml(Convert.ToString(FormState["QuoteCart"]));

    if (xmlDoc != null)

    {

     

    foreach (XElement pn in xmlDoc.Descendants("PartNumber"))

    {

    XPathNavigator Group = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber", NamespaceManager);

    Group.InsertAfter(Group);

    if (!MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber/my:Title", NamespaceManager).HasChildren)

    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber/my:Title", NamespaceManager).AppendChild(pn.Element("Title").Value);

    else

    {

    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber/my:Title", NamespaceManager).AppendChild(pn.Element("Title").Value);

    }

    MainDataSource.CreateNavigator().SelectSingleNode(
    "/my:myFields/my:Product/my:PartNumber/my:PartNo", NamespaceManager).AppendChild(pn.Element("PartNo").Value);

    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber/my:Description", NamespaceManager).AppendChild(pn.Element("Description").Value);

    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Product/my:PartNumber/my:Url", NamespaceManager).AppendChild(pn.Element("Url").Value);

    }

     

     

     

     

    }

     

     

    }

     

    some one please help how i can find the current row while binding data in a repeater control.

    Thanks,

    Devendra

     

     

  • 08-29-2011 11:04 AM In reply to

    Re: problem while binding repeater control with xml file programitically

    One clear issue is that you are using AppendChild to try to set nodes' values when you should be using SetValue().

     I'm not sure what the issue you're describing is though.  What do you mean, specifically, when you say "the current row?"

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.