I have a basic menu created successfully, but would like to have a template applied to a couple dynamically created items.
I would like to have a User Control be the contents so that the management of the content can be controlled separately.
So my basic scenario is this:
Create Root Menu item, Create Sub item, Apply ItemTemplate, Create New Sub Item, Undo Template...
My Template is such:
Im getting the Parent and it knows theres a sub, and expanding just gives me a little tiny box with no content...
Any Ideas?
I would like to have a User Control be the contents so that the management of the content can be controlled separately.
So my basic scenario is this:
Create Root Menu item, Create Sub item, Apply ItemTemplate, Create New Sub Item, Undo Template...
My Template is such:
'ItemTemplate Class. Just pulls the User Control
Class QC_HACCP_Hold
Implements ITemplate
Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
Dim lit1 As New QC_HACCP_Hold_Lot
container.Controls.Add(lit1)
End Sub
End Class
'User Control write up - QC_HACCP_Hold_Lot
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="QC_HACCP_Hold_Lot.ascx.vb" Inherits="sadlersnet.QC_HACCP_Hold_Lot" %>
<
asp:panel
id
=
"pnlHold"
runat
=
"server"
>
<
p
>
Enter Lot Number to Place on Hold<
br
/>
<
asp:TextBox
ID
=
"txtLotNumber"
runat
=
"server"
></
asp:TextBox
><
asp:Button
ID
=
"cmdHoldLot"
runat
=
"server"
Text
=
"Set to Hold"
/>
</
p
>
</
asp:panel
>
'Code to Create Parent and Sub with Template Applied
Dim _QCHACCP_Place_Lot_On_Hold As RadMenuItem = AddMenuItem("Place Lot on Hold", Nothing, False)
With _QCHACCP_Place_Lot_On_Hold
Dim _QC_HoldTemplate As New Custom_Rad_Templates.QC_HACCP_Hold
mnuMain.ItemTemplate = _QC_HoldTemplate
.Items.Add(New RadMenuItem)
End With
'Helper function for creating menuitems
Private Function AddMenuItem(ByVal Caption As String, URL As String, ByVal AutoPostBack As Boolean, Optional ByVal Target As String = Nothing) As RadMenuItem
Dim _MenuItem As RadMenuItem = New RadMenuItem
_MenuItem.PostBack = AutoPostBack
_MenuItem.NavigateUrl = URL
_MenuItem.Text = Caption
If Not IsNothing(Target) Then _MenuItem.Target = Target
Return _MenuItem
End Function
Im getting the Parent and it knows theres a sub, and expanding just gives me a little tiny box with no content...
Any Ideas?