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!

EditCommandColumn

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
How do I reference the ID of a EditCommandColumn??

I am trying to make the visable property either true or false based on a condition. exactly like cmdDelete. But there is no ID for the EditCommandColumn.

Thanks in advance

If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then

Dim chkB As CheckBox = New CheckBox
Dim lblStatus As Label = New Label
chkB = CType(e.Item.FindControl("chkStatus"), CheckBox)
lblStatus = CType(e.Item.FindControl("Status"), Label)
Dim cmdDelete As LinkButton = CType(e.Item.FindControl("cmdDelete"), LinkButton)

If lblStatus.Text = "OPEN" Then
chkB.Checked = False
Else
chkB.Checked = True
chkB.Enabled = False
cmdDelete.Visible = False
End If
End If

 
If e.Item.ItemType = ListItemType.EditItem Then
' now you should be able to reference
'controls in your EditItem Template
End If
 
Thats what I already have above but what's it called..how do I reference the EditCommandColumn that has no ID associated with it?

e.g.
Dim cmdDelete As LinkButton = CType(e.Item.FindControl("cmdDelete"), LinkButton)

How do I find that control?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top