Databound Event


/ Published in: VB.NET
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ' Event will occur after loading the DataBind() Property of DataGrid
  2. Private Sub gdSIMLOGS_DataBoundEvent(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles gdGSIMLOGS.ItemDataBound
  3.  
  4. If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.SelectedItem Then
  5. ' name will store the RefNos of the RefNo Column
  6. Dim name As String = ""
  7. name = Convert.ToString((DirectCast(e.Item.DataItem, DataRowView))(0))
  8.  
  9. ' check each ref no. if null Resend button will be disabled
  10. If name = Nothing Or name = "" Then
  11. DirectCast(e.Item.FindControl("btnResend"), Button).Enabled = False
  12. End If
  13. End If
  14. End Sub

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.