Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
#Region "ifgEntryForm_RowDataBound"
    Protected Sub ifgEntryForm_RowDataBound(sender As Object, e As iInterchange.WebControls.v4.Data.iFlexGridRowEventArgs) Handles ifgEntryForm.RowDataBound
        Try
            'Dim intStdnt_id As Integer
            'Dim drv As DataRowView = CType(e.Row.DataItem, Data.DataRowView)
            'If Not drv.Row.Item(EntryFormData.STDNT_ID) Is DBNull.Value Then
            '    intStdnt_id = CInt(drv.Row.Item(EntryFormData.STDNT_ID))
            'End If
            If e.Row.RowType = DataControlRowType.DataRow Then
                Dim imgLink As Image
                imgLink = CType(e.Row.Cells(3).Controls(0), Image)
                imgLink.ToolTip = "More Info"
                imgLink.ImageUrl = "../Images/info.png"
                imgLink.Attributes.Add("style", "cursor:pointer;margin-left:5px;")
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
#End Region
Posted
Updated 25-Oct-15 23:32pm
v2

The error message is pretty explicit:
Handles clause requires a WithEvents variable defined in the containing type or one of its base types
It even tells you what to do to fix it!

So look at the containing class, and check what it is based on: if that class does not handle events, then your class won't either and you need to add WithEvents: https://msdn.microsoft.com/en-us/library/6k46st1y.aspx[^]
 
Share this answer
 
Lets say the code block you showed is contained in a "Whatever.vb" file.
You also should have in your project a "Whatever.Designer.vb" file.
In this file, find the line where the ifgEntryFrom variable is declared. It should be something like:
VB
Dim Private ifgEntryForm As FlexGrid

Try to change it for:
VB
Dim Private WithEvents ifgEntryForm As FlexGrid
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900