How do you set the value of Drop Down User Control

P

Paul D. Fox

I'm using a User Control to display a drop-down and when I "Edit" a screen,
I want to set the Drop-Downs value to the value obtained from the Database.
Something like:

ddlUserControl.ControlID.Insert(0,drReader("EmployeeName")) which doesn't
seem to work. Help!

Paul
 
V

Visar Gashi, MCP

Why don't you just simply set the selected value:

ddlUserControl.SelectedValue = drReader("EmployeeName").ToString();

That is assuming that the value exists on the list.

Regards,
-Visar
 

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

Members online

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top