link infopath dropdownbox with windows treecontrol - InfoPath Dev
in

InfoPath Dev

link infopath dropdownbox with windows treecontrol

Last post 02-26-2007 09:06 AM by Shiraz Cupala. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-15-2007 01:04 PM

    link infopath dropdownbox with windows treecontrol

    Hello All,
    I am using infopath 2007 and am hosting the infopath form using the form control in a windows application in visual studio 2005. In my windows project i have a tree view control, what i would like to do is after the treeview node is selected i want to match the text on the selected node to the text in a drop down box that is on my infopath form, the dropdown box is populated from the same database as the tree control and when the form loads i can see the items in the dropdown box, i just don't understand how to change the selected value of the dropdown box from inside my windows app.

    Here is a visual example.

    TreeControl Drop Down Box on infopath form

    1 1
    2 2
    3 3
    4 4
    5 5

    lets say the user selected node with text # 3 on the tree control, i want the selected item of the dropdown box to change to 3 to reflect the selection on the treecontrol..

    anyone know how to do this?
    Erin
  • 02-15-2007 01:29 PM In reply to

    Re: link infopath dropdownbox with windows treecontrol

    OK so more information.
    I have realized that you can easily do this by setting the text of the XML node of the main data source to whatever text you want however, i want to be able to only select whatever values are available in the drop down box itself. So for instance, if i select 5 from the tree control and the value 5 does not exist in the drop down box i don't want it to show up in the DDbox, in that case i want to display a message or something along those lines alerting the user that this value cannot be selected.
  • 02-26-2007 09:06 AM In reply to

    Re: link infopath dropdownbox with windows treecontrol

    In this situation you will have to write code as part of your tree selector to first check if the value is allowed in the dropdown, and if not then display the message instead. A few questions:
    1) where did you want to display that message? dialog would be easiest and then just ignore the selection.
    2) where do you get the values that are listed in the dropdown? ideally you're getting them from an xml lookup file so that it's easy for your code to lookup valid values.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.