I have been trying to figure out how to get the Click event of a button that is created in an ITemplate for a menu item to bubble up to the top menu item layer.
I have a multi layer menu (for an intranet site, multiple top level and children/children layers)
Within one, I have created a 2nd generation child that spawns another child that has a custom template the adds a text box and a button for a quick entry method.
MAIN MENU / IT / DO SOMETHING / (iTemplate Textbox + Button)
What I need is to be able to (hopefully) to capture the event at the menu item click event to handle the event in the same page and not in the ITemplate (I am able to intercept the click event in the ITemplate class)
The Menu Item Createion is a follows:
Dim _JobLines As New RadMenuItem
_JobLines.Text = "Clear Job Lines"
.Add(_JobLines) ' Adds to the parent menu
Dim _JobLinesTextBox As New RadMenuItem ' This is the menu item with the custom ITemplate instantiation
Dim _template As New Custom_Rad_Templates.TextBoxTemplate()
_template.InstantiateIn(_JobLinesTextBox)
_JobLines.Items.Add(_JobLinesTextBox)
ITemplate Class:
Class TextBoxTemplate
Implements ITemplate
Public Event Go_Click(sender As Object, e As EventArgs)
Public Sub InstantiateIn(ByVal container As Control)
Dim txtEntry As New TextBox()
txtEntry.ID = "txtEntry"
Dim cmdGo As New Button
cmdGo.ID = "cmdGo"
cmdGo.Text = "Go"
AddHandler cmdGo.Click, AddressOf cmdGo_Click
container.Controls.Add(txtEntry)
container.Controls.Add(cmdGo)
End Sub
Public Sub cmdGo_Click(sender As Object, e As EventArgs)
RaiseEvent Go_Click(Me, e) ' (This is where I lose the event)
End Sub
Public Sub InstantiateIn1(container As Control) Implements ITemplate.InstantiateIn
End Sub
End Class
Im sure this has been done before, just cant find any clear help on the issue.
Thanks
I have a multi layer menu (for an intranet site, multiple top level and children/children layers)
Within one, I have created a 2nd generation child that spawns another child that has a custom template the adds a text box and a button for a quick entry method.
MAIN MENU / IT / DO SOMETHING / (iTemplate Textbox + Button)
What I need is to be able to (hopefully) to capture the event at the menu item click event to handle the event in the same page and not in the ITemplate (I am able to intercept the click event in the ITemplate class)
The Menu Item Createion is a follows:
Dim _JobLines As New RadMenuItem
_JobLines.Text = "Clear Job Lines"
.Add(_JobLines) ' Adds to the parent menu
Dim _JobLinesTextBox As New RadMenuItem ' This is the menu item with the custom ITemplate instantiation
Dim _template As New Custom_Rad_Templates.TextBoxTemplate()
_template.InstantiateIn(_JobLinesTextBox)
_JobLines.Items.Add(_JobLinesTextBox)
ITemplate Class:
Class TextBoxTemplate
Implements ITemplate
Public Event Go_Click(sender As Object, e As EventArgs)
Public Sub InstantiateIn(ByVal container As Control)
Dim txtEntry As New TextBox()
txtEntry.ID = "txtEntry"
Dim cmdGo As New Button
cmdGo.ID = "cmdGo"
cmdGo.Text = "Go"
AddHandler cmdGo.Click, AddressOf cmdGo_Click
container.Controls.Add(txtEntry)
container.Controls.Add(cmdGo)
End Sub
Public Sub cmdGo_Click(sender As Object, e As EventArgs)
RaiseEvent Go_Click(Me, e) ' (This is where I lose the event)
End Sub
Public Sub InstantiateIn1(container As Control) Implements ITemplate.InstantiateIn
End Sub
End Class
Im sure this has been done before, just cant find any clear help on the issue.
Thanks