Protected Sub gdvLineItems_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Dim rowIndex As Integer = 0 If (e.Row.RowType = DataControlRowType.DataRow) Then Dim dt As DataTable = ViewState("Grid") For i As Integer = 1 To dt.Rows.Count Dim lnk As LinkButton = DirectCast(e.Row.FindControl("btndownload"), LinkButton) If Not dt.Rows(rowIndex)("File") Is String.Empty Then lnk.Enabled = True Else lnk.Enabled = False End If rowIndex += 1 Next End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)