linking drop down box with value in tree control

E

esebastian

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.

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
 
M

[MSFT] AlexWein

In your hosting application, you have access to the DOM of the infopath form.
The dropdown is bound to some value in the DOM; if you change the value of
that DOM node, the selected value in the dropdown will change, too.
 
E

esebastian

Hi Alex,
Thanks so much for your reply.
OK so i figured out that i can set the value of the DOM but what i
want to do 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 a tree control and the value 5 does not exist in the
drop down box i don't want it to show up in the DropDownbox, in that
case i want to display a message or something along those lines
alerting the user that this value cannot be selected. Can this be
done??
 
S

S.Y.M. Wong-A-Ton

If the drop down box is being populated from a source (either main data
source or secondary data source), you can look up the value in the list of
values and return a message if the value cannot be found.

Since you've been posting the answers to all of your unanswered questions in
this newsgroup, I wrote a possible solution to this problem for you (I do not
do this often :) ). See
http://enterprise-solutions.swits.n...em-does-not-exist-in-combo-box&c=infopath2007

While I wrote the solution for a combo box, it should also work for a
drop-down list box.
 
E

esebastian

I have tried to reply to this message a few times without the reply
going through on this end so if you see more than one reply -- so
sorry.

Thanks so much S.Y.M, the above worked famously!!! I do have a
question for you though. My form has a few comboboxes on it and the
combo boxes have many entries in them, up to 50-60 each... I am
wondering if we can put the Entries fields somewhere else, like in a
secondary data source, if we put them all in the main data source ,
the main data source is going to be HUGE... any wisdom to push my way
on this one???
Thanks,
Erin
 
S

S.Y.M. Wong-A-Ton

Absolutely! The solution would work equally well if you used secondary data
sources. The whole idea behind this solution is that there must be a list of
items somewhere that can be checked against. If the items are static, that
is, if you entered them manually into the drop-down, then there would be no
such list. So the items have to be stored either in the main data source or a
secondary data source, whichever suits you best.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top