Programatically controlling the inner controls of a Formview Control

N

Neil

I'm trying to get up to speed on ASP.Net & C# development having come from a
VB6 background.

I know that I can refer to an inner control of a formview control by using a
lines such as

DropDownList ddlDeactivationId;
int deacId;
ddlDeactivationId =
(DropDownList)FormView1.Row.FindControl("DropdownList2");
deacId = ddlDeactivationId.SelectedIndex;


What I'd like to know (and haven't figured out yet) is how I can
programatically set the value of one of these inner controls?
 
G

Guest

DropDownList ddlDeactivationId;
ddlDeactivationId = (DropDownList)FormView1.Row.FindControl("DropdownList2");
ddlDeactivationId.SelectedIndex = 2 //you can set the values like this...

Thanks,
Sridhar.
 

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
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top