Llenar un Cuadro de lista desplegable - InfoPath Dev
in

InfoPath Dev

Llenar un Cuadro de lista desplegable

Last post 10-25-2007 07:40 AM by hguevara. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-26-2007 08:16 AM

    Llenar un Cuadro de lista desplegable

    Saludos lo que busco
    es como llenar una lista desplegable
    estoy que me guio de este codigo
    usando sentencias XPath que me permitan manipular
    los datos xml del infopath
    este es un ejemplo que me hace recorrer  una tabla extensible

    public void ProcessEmailAddresses()
    {
        XPathNavigator doc = MainDataSource.CreateNavigator();
      .

        XPathNodeIterator iterator = doc.Select("/my:DataFields/my:Attendees/my:Attendee", NamespaceManager);


        while (iterator.MoveNext())
        {
            ..............
        }


    }

    lo que yo busco es como poblarla(llenar datos)!
    sea una tabla extensible o una lista desplegable.

  • 07-26-2007 09:48 AM In reply to

    Re: Llenar un Cuadro de lista desplegable

    Saludos hguevara,

     Este blog tiene mucho código como llenando una tabla en el fuente principal de datos desde un fuente secondario de datos.  El código es por InfoPath 2003, pero tiene buen ideas.  Mira a esta código

     http://www.infopathdev.com/blogs/matt/archive/2005/11/29/Repeat-Table-Headers-Across-Multiple-Printed-Pages.aspx

     while(oSrc = oVehicles.nextNode())
    {   
        var oNewRow = oSampleRow.cloneNode(true);

        oNewRow.selectSingleNode("my:Year").text = oSrc.selectSingleNode("@year").nodeValue;
        oNewRow.selectSingleNode("my:Make").text = oSrc.selectSingleNode("@make").nodeValue;
        oNewRow.selectSingleNode("my:Model").text = oSrc.selectSingleNode("@model").nodeValue;
        oNewRow.selectSingleNode("my:Description").text = oSrc.selectSingleNode("@description").nodeValue;

        // Add the row to the table that is on the current page.
        XDocument.DOM.selectSingleNode("/my:myFields/my:Document/my:Page[" + iCurrentPageIndex + "]/my:Table").appendChild(oNewRow);

    } // End while looping through all source nodes.

    Espero que esta ayuda¡!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-30-2007 06:53 AM In reply to

    Re: Llenar un Cuadro de lista desplegable

    cual es la forma de poder ver el XML ke genera el INFOPATH!

    kuando genero! el codigo

    XDocument.DOM.selectNodes

    no me rekonoce el DOM            Gracias!

  • 10-25-2007 07:40 AM In reply to

    Re: Llenar un Cuadro de lista desplegable

     

    > XPathNavigator main = this.MainDataSource.CreateNavigator();


     

    > XPathNavigator sectionNode = main.SelectSingleNode("/my:myFields/my:group1",


     

    > this.NamespaceManager);


     

     

    > string ns = sectionNode.NamespaceURI;


     

    > using (XmlWriter xw = sectionNode.AppendChild())


     

    > {
     
     


     

    > xw.WriteStartElement("my", "group2", ns);


     

    > xw.WriteElementString("my", "field1", ns, "Value for field 1");


     

    > xw.WriteElementString("my", "field2", ns, "Value for field 2");


     

    > xw.WriteElementString("my", "field3", ns, "Value for field 3");


     

    > xw.WriteEndElement();


     

    > }
    utilize este codigo  y si me funciono


     pero solo funciona con campos de texto(fields) pero no con cuadro de lista desplegable

    alguien tiene la forma?

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.