Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically setting defaults in a FormView

Status
Not open for further replies.

dgerdner

Programmer
Mar 30, 2005
41
0
0
US
If I am in Edit mode, I am able to access my textboxes in the Edit Template using code such as this:

FormViewRow FVrow = FormView1.Row;
DropDownList dd;
dd = (DropDownList)FormView1.FindControl("ddActive_Flg");
dd.SelectedValue = "Y";

However, if I try this after setting the FormView to Insert mode, the FormViewRow is still null immediately after binding the data. What technique can I use in order to access the controls in my FormView when there are not yet any rows in my binding datasource?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top