/ Published in: VB.NET
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
' Event will occur after loading the DataBind() Property of DataGrid Private Sub gdSIMLOGS_DataBoundEvent(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles gdGSIMLOGS.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.SelectedItem Then ' name will store the RefNos of the RefNo Column Dim name As String = "" name = Convert.ToString((DirectCast(e.Item.DataItem, DataRowView))(0)) ' check each ref no. if null Resend button will be disabled If name = Nothing Or name = "" Then DirectCast(e.Item.FindControl("btnResend"), Button).Enabled = False End If End If End Sub