Could you elaborate a little?
Here is what i have so far in my template class ...
Public Class GridViewTemplate
Inherits Page
Implements ITemplate
Dim templateType As DataControlRowType
Dim controlid1 As String
Sub New(ByVal type As DataControlRowType, ByVal id1 As String)
templateType = type
controlid1 = id1
End Sub
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
Select Case templateType
Case DataControlRowType.DataRow
Dim oCheckBox As New CheckBox
oCheckBox.ID = controlid1
oCheckBox.AutoPostBack = True
container.Controls.Add(oCheckBox)
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 GridViewTemplate(DataControlRowType.DataRow, "chkSelect")
End With
GridControl.Columns.Add(oTemplateField)
So, how do i raise the event (checkchanged) from within my GridViewTemplate Class and then hadle that even from within the page that contains the GridControl.
Thanks so much!
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ex**************@TK2MSFTNGP04.phx.gbl...
your template should implement IPostBackEventHander. you can raise the
event.
-- bruce (sqlwork.com)
"Ben Schumacher" <bs*********@navegate.comwrote in message
news:uq*************@TK2MSFTNGP05.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