Programatically controlling the inner controls of a Formview Control

  • Thread starter Thread starter Neil
  • Start date Start date
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?
 
DropDownList ddlDeactivationId;
ddlDeactivationId = (DropDownList)FormView1.Row.FindControl("DropdownList2");
ddlDeactivationId.SelectedIndex = 2 //you can set the values like this...

Thanks,
Sridhar.
 
Back
Top