Programmatically Add the fields to DropDownList - InfoPath Dev
in

InfoPath Dev

Programmatically Add the fields to DropDownList

Last post 04-24-2006 10:06 AM by Matt Faus. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 09-09-2005 01:40 AM

    Programmatically Add the fields to DropDownList

    Dear Friends,

    I developing some infopath Application.
    I have to populate the Values to DropDownList Dynamically...thats means by coding...By coding I have to connect the Database and retrieve the Value for the DropDownList and populates.

    I am get the DropDownList from the Design mode like this,

    IXMLDOMNode ddlCustType = thisXDocument.DOM.selectSingleNode("my:myFields/my:ddlCustomerType");

    After that I dont know the next steps.....

    for test I did like that,

    ddlCustType.text = "hello world";

    Its not taking....

    AnyOne can please help me.

    Thanks in Advance.

    Vasanth.

  • 09-09-2005 05:44 AM In reply to

    Re: Programmatically Add the fields to DropDownList

    Hi,

    For make this possible you have to connect your database as a secondary datasource in infopath design! But at the last screen of the wizard uncheck "autmatically retreive..." after that go on your drop down properties and bind it to the datasource.

    And in the code write only this line:

    thisXDocument.DataObjects["thenameofyourdatasource"].Query();	


    But with this you can't create your custom SQL request in your database it's always the same!

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 09-10-2005 09:53 PM In reply to

    Re: Programmatically Add the fields to DropDownList

    You can also use Rules to Query the secondary data source.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-12-2005 10:52 PM In reply to

    Re: Programmatically Add the fields to DropDownList

    quote:
    Originally posted by Patrick Halstead

    You can also use Rules to Query the secondary data source.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev



    Thank you....very much Mr.Patrick Halstead
    If you dont mind...Can you give same examples?.
    Vasanth.
  • 09-12-2005 10:55 PM In reply to

    Re: Programmatically Add the fields to DropDownList

    quote:
    Originally posted by Virgul

    Hi,

    For make this possible you have to connect your database as a secondary datasource in infopath design! But at the last screen of the wizard uncheck "autmatically retreive..." after that go on your drop down properties and bind it to the datasource.

    And in the code write only this line:

    thisXDocument.DataObjects["thenameofyourdatasource"].Query();	


    But with this you can't create your custom SQL request in your database it's always the same!

    ++

    Thierry

    Every moment hesitated is a moment gone for life!!! Think about it



    Thank you very much Mr.Virgul.
    Its really Helpful to me.

    Vasanth.
  • 04-24-2006 07:52 AM In reply to

    Re: Programmatically Add the fields to DropDownList

    Hi all,

    but how is it possible to add values to a DDL programmatically.
    Is there any way ?

    Thx
    Listen to Motörhead cos they play Rock'n Roll :)
  • 04-24-2006 10:06 AM In reply to

    Re: Programmatically Add the fields to DropDownList

    Hi Jerome,

    Please check out these HowTos:

    http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85
    http://infopathdev.com/howto/tutorials/default.aspx?i=7f693c75c5c94604b01bdfd3a1edaedc
    http://infopathdev.com/howto/tutorials/default.aspx?i=987250af134b4ced85cbddc7db724202

    Hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.