K
KJ
I have been searching for 2 days on how to handle a imagebutton click
event inside a template column on a datagrid control. Does anyone know
how to do it?
The ItemClick Event does not fire when I click the image button
therefore the event never gets raised to the webform. Please Help
My code is below
Public Class DataGridTemplate
Implements ITemplate
Dim templateType As ListItemType
Dim columnName As String
Event ItemImageClick(ByVal source As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
Sub New(ByVal type As ListItemType, ByVal ColName As String)
templateType = type
columnName = ColName
End Sub
Sub InstantiateIn(ByVal container As Control) _
Implements ITemplate.InstantiateIn
ib = New ImageButton()
ib.ImageUrl = Select.gif"
ib.ToolTip = "Select Item"
ib.ImageAlign = ImageAlign.AbsBottom
ib.CommandName = "Select"
AddHandler ib.Click, AddressOf ItemClick
container.Controls.Add(ib)
End Sub
Public Sub ItemClick(ByVal sender As Object, _
ByVal e As
System.Web.UI.ImageClickEventArgs)
RaiseEvent ItemImageClick(Me, e)
End Sub
event inside a template column on a datagrid control. Does anyone know
how to do it?
The ItemClick Event does not fire when I click the image button
therefore the event never gets raised to the webform. Please Help
My code is below
Public Class DataGridTemplate
Implements ITemplate
Dim templateType As ListItemType
Dim columnName As String
Event ItemImageClick(ByVal source As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
Sub New(ByVal type As ListItemType, ByVal ColName As String)
templateType = type
columnName = ColName
End Sub
Sub InstantiateIn(ByVal container As Control) _
Implements ITemplate.InstantiateIn
ib = New ImageButton()
ib.ImageUrl = Select.gif"
ib.ToolTip = "Select Item"
ib.ImageAlign = ImageAlign.AbsBottom
ib.CommandName = "Select"
AddHandler ib.Click, AddressOf ItemClick
container.Controls.Add(ib)
End Sub
Public Sub ItemClick(ByVal sender As Object, _
ByVal e As
System.Web.UI.ImageClickEventArgs)
RaiseEvent ItemImageClick(Me, e)
End Sub