inserting value-display name pair in Drop down box programmatically

G

Gaurav Bhardwaj

Hi,

Is there any way to insert value-display name pair in Drop down box
programmatically at runtime?

Thanks,
Gaurav
 
G

Greg Collins [InfoPath MVP]

G

Gaurav Bhardwaj

Hi ,

Many thanks for the reply.

The code in the article works great but my problem is slightly different. I
need to insert the values in drop down without any manual intervention.



I have created a custom control which can be placed on any InfoPath form.
The control can access the InfoPath’s document model. I am able to read and
write values in a text box through that control but not in a drop down box.
To summarize, I want to insert data into drop-down box from code behind dll
(in C#) without making any manual changes in the template files. Is there
any work around for my problem?



Thanks,

Gaurav


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Are either of these helpful?

Populate a Drop-Down List Box via Code
http://www.infopathdev.com/howto/tutorials/default.aspx?i=987250af134b4ced85cbddc7db724202

Populate a Drop-Down List Box via a Secondary Data Source
http://www.infopathdev.com/howto/tutorials/default.aspx?i=7f693c75c5c94604b01bdfd3a1edaedc

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


Hi,

Is there any way to insert value-display name pair in Drop down box
programmatically at runtime?

Thanks,
Gaurav
 
G

Greg Collins [InfoPath MVP]

I am not aware of a way to do that. Sorry.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


Hi ,

Many thanks for the reply.

The code in the article works great but my problem is slightly different. I
need to insert the values in drop down without any manual intervention.



I have created a custom control which can be placed on any InfoPath form.
The control can access the InfoPath’s document model. I am able to read and
write values in a text box through that control but not in a drop down box.
To summarize, I want to insert data into drop-down box from code behind dll
(in C#) without making any manual changes in the template files. Is there
any work around for my problem?



Thanks,

Gaurav


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Are either of these helpful?

Populate a Drop-Down List Box via Code
http://www.infopathdev.com/howto/tutorials/default.aspx?i=987250af134b4ced85cbddc7db724202

Populate a Drop-Down List Box via a Secondary Data Source
http://www.infopathdev.com/howto/tutorials/default.aspx?i=7f693c75c5c94604b01bdfd3a1edaedc

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


Hi,

Is there any way to insert value-display name pair in Drop down box
programmatically at runtime?

Thanks,
Gaurav
 

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