سؤال

I'm trying to hide the "Delete" linkbutton in the datagrid for the first row only, but would like to display "Delete" linkbutton button in rest of the rows. How can i achieve that, any help is much appreciated.

enter image description here

هل كانت مفيدة؟

المحلول

Found the solution.

Private Sub dgRolloverInformation_ItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgRolloverInformation.ItemDataBound
            'Hide "Delete" button for the first row in the RolloverInformation Datagrid
            If (e.Item.ItemIndex = 0) Then
                Dim btnDelete As LinkButton = CType(e.Item.Cells(4).FindControl("lnkbtnDelete"), LinkButton)
                btnDelete.Visible = False
            End If
        End Sub
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top