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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top