F
Faizan Ahmed
Hello all,
I've been stuck in this problem for a couple of days now and could'nt get
any closer to the solution.. any help will be highly appreciated..
I have a server control that i derived from DataGrid control. This custom
control also has a Microsoft IE Toolbar control which contains some toolbar
buttons
The declaration of the class is :
Public Class EnhancedBrowse
Inherits DataGrid
Protected WithEvents mFooterToolbar As New
Microsoft.Web.UI.WebControls.Toolbar
The code in the OnInit method is
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
dim table As New HtmlControls.HtmlTable
table.Attributes.Add("runat", "server")
Dim tRow As New HtmlControls.HtmlTableRow
Dim td As New HtmlControls.HtmlTableCell
tRow.Attributes.Add("runat", "server")
td.Attributes.Add("runat", "server")
tRow.Controls.Add(td)
mHeaderToolbar.AutoPostBack = True
mHeaderToolbar.Attributes.Add("runat", "server")
AddHandler mHeaderToolbar.ButtonClick, New EventHandler(AddressOf
mHeaderToolbar_ButtonClick)
AddToolbarButtons(mHeaderToolbar, mHeaderToolbarCollection) ' This is a
method that creates buttons in the toolbar
mHeaderToolbar.Attributes.Add("id", "mHeaderToolBar")
td.Controls.Add(mHeaderToolbar)
table.Rows.Add(tRow)
Me.Controls.Add(table)
End Sub
All the events raised by the grid are captured in this control's class, but
the button click of the toolbar control is not captured in the parent
control.
I have to capture the event of the toolbar buttons and do some processing on
the grid's data.
If i add an attribute like
mHeaderToolbar.Attributes.Add("onButtonClick","MyHandler"), it does not
raises the event... i've tried overriding the OnBubbleEvent()
method of my control but it does not get events of the toolbar. some one
please help me out...
~Dejavou
I've been stuck in this problem for a couple of days now and could'nt get
any closer to the solution.. any help will be highly appreciated..
I have a server control that i derived from DataGrid control. This custom
control also has a Microsoft IE Toolbar control which contains some toolbar
buttons
The declaration of the class is :
Public Class EnhancedBrowse
Inherits DataGrid
Protected WithEvents mFooterToolbar As New
Microsoft.Web.UI.WebControls.Toolbar
The code in the OnInit method is
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
dim table As New HtmlControls.HtmlTable
table.Attributes.Add("runat", "server")
Dim tRow As New HtmlControls.HtmlTableRow
Dim td As New HtmlControls.HtmlTableCell
tRow.Attributes.Add("runat", "server")
td.Attributes.Add("runat", "server")
tRow.Controls.Add(td)
mHeaderToolbar.AutoPostBack = True
mHeaderToolbar.Attributes.Add("runat", "server")
AddHandler mHeaderToolbar.ButtonClick, New EventHandler(AddressOf
mHeaderToolbar_ButtonClick)
AddToolbarButtons(mHeaderToolbar, mHeaderToolbarCollection) ' This is a
method that creates buttons in the toolbar
mHeaderToolbar.Attributes.Add("id", "mHeaderToolBar")
td.Controls.Add(mHeaderToolbar)
table.Rows.Add(tRow)
Me.Controls.Add(table)
End Sub
All the events raised by the grid are captured in this control's class, but
the button click of the toolbar control is not captured in the parent
control.
I have to capture the event of the toolbar buttons and do some processing on
the grid's data.
If i add an attribute like
mHeaderToolbar.Attributes.Add("onButtonClick","MyHandler"), it does not
raises the event... i've tried overriding the OnBubbleEvent()
method of my control but it does not get events of the toolbar. some one
please help me out...
~Dejavou