Could you elaborate a little?
Here is what i have so far in my template class ...
Public Class GridViewTemplat e
Inherits Page
Implements ITemplate
Dim templateType As DataControlRowT ype
Dim controlid1 As String
Sub New(ByVal type As DataControlRowT ype, ByVal id1 As String)
templateType = type
controlid1 = id1
End Sub
Public Sub InstantiateIn(B yVal container As System.Web.UI.C ontrol) Implements ITemplate.Insta ntiateIn
Select Case templateType
Case DataControlRowT ype.DataRow
Dim oCheckBox As New CheckBox
oCheckBox.ID = controlid1
oCheckBox.AutoP ostBack = True
container.Contr ols.Add(oCheckB ox)
oCheckBox = Nothing
Case Else
' Unexpected Handler ...
End Select
End Sub
End Class
Then in the page is add the checkbox column with ...
oTemplateField = New TemplateField
With oTemplateField
oTemplateField. ItemTemplate = New GridViewTemplat e(DataControlRo wType.DataRow, "chkSelect" )
End With
GridControl.Col umns.Add(oTempl ateField)
So, how do i raise the event (checkchanged) from within my GridViewTemplat e Class and then hadle that even from within the page that contains the GridControl.
Thanks so much!
"bruce barker (sqlwork.com)" <b_************ *************@s qlwork.comwrote in message news:ex******** ******@TK2MSFTN GP04.phx.gbl...
your template should implement IPostBackEventH ander. you can raise the
event.
-- bruce (sqlwork.com)
"Ben Schumacher" <bs*********@na vegate.comwrote in message
news:uq******** *****@TK2MSFTNG P05.phx.gbl...
>Ok smart guys and gals ...
I have a GridView control with a dynamically created checkbox column. The
checkbox is created using ITemplate interface. In my class that
implements the ITemplate interface I set the AutoPostBack property of the
checkbox to True. When the checkbox is clicked, I want to handle the
CheckChanged event of the checkbox on the webform (.aspx) that contains
the GridView control. I can easily use the addhandler instruction in the
ITemplate interface class to handle the CheckChanged event, but how do I
bubble the event out to the actual .aspx page that contains the gridview
control??????? ?????
I have been googling for hours. It seems no one has any idea how to do
this. I would be so incredibly grateful for any insight into my problem.
Ben