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

formview show edit button

Status
Not open for further replies.

Dimitrie1

Programmer
Jan 5, 2007
138
CA
I have a gridview that drives a formview. The formview and gridview both have a field called condtion. The formview has an itemtempate and edititemtemplate.

If the condition = 'sold' or 'pending sale' or 'pending transfer' then I don't want the formview to go into edit mode.

I thought the nicest/cleanest method would be to check the value of condition and make the edit button visible/hidden based on the field but I can't find an event on the formview to allow me to do this.

Code:
Dim x As Label = FormView2.FindControl("ConditionLabel")
        Dim y As Button = FormView2.FindControl("EditButton")
        If x.Text = "Sold" Or x.Text = "Pending Sale" Or x.Text = "Pending Transfer" Then
            y.Visible = False
        Else
            y.Visible = True
        End If

 
use the FormView.ChangeMode() method. to use the different templates. If that's not what your looking for try setting the AllowEdit (or some property like that) to false.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
okay but from what event - I think that's my first problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top