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!

Datagrid and EditCommandColumn 1

Status
Not open for further replies.

ecannizzo

Programmer
Sep 19, 2000
213
US
I have a datagrid that displays a bunch of bound columns to a grid. Multiple rows always come back. I have the last column as a EditCommandColumn and this shows an Edit link in each row of the last column. The thing is I only want to display the Edit link for the first row and all the other rows in that column I want blank. Is there any way to do this?

Thanks!
 
Yes, use the ItemDataBound event, check for your condition and if it exists, hide the relevant control


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks. This worked:


Code:
Private Sub gridname_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles gridname.ItemDataBound
            If e.Item.ItemIndex > 0 Then
                e.Item.Cells(12).Text = ""
            End If
  End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top