Return to Snippet

Revision: 29499
at July 30, 2010 17:12 by swavaldez


Updated Code
' 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

Revision: 29498
at July 30, 2010 17:12 by swavaldez


Initial Code
' 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

Initial URL


Initial Description


Initial Title
Databound Event

Initial Tags


Initial Language
VB.NET