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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the mode of Form View or DetailsView

Status
Not open for further replies.

kav123

Programmer
Jan 12, 2005
210
GB
How do you change the readonly mode of FormView or DetailsView .
Ive tried the following but none work:
if (IsPostBack)
{
if (Request.Form["__EVENTTARGET"] == "lnkEdit")
{
FormView1.ChangeMode(FormViewMode.Edit);
FormView1.DefaultMode = FormViewMode.Edit;
}
}

and tried this as well:

protected void lnkEdit_Click(object sender, EventArgs e)
{
FormView1.ChangeMode(FormViewMode.Edit);
}

Any ideas.
 
Gidday

FormView1.ChangeMode(FormViewMode.Edit) should work.

You could also try changing the default mode:
FormView1.DefaultMode = FormViewMode.Edit

Hope that helps

Cheers
Wally
 
you should not need to preform this check
Code:
if (Request.Form["__EVENTTARGET"] == "lnkEdit")
you show the code for the link button, but have you assigned the delegate to the event? when you grid/detail/form/repeater I favor the Command event handler over individual delegates for each event.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top