Hi,
I am trying to add a web user control(.ascx) in the RAD Toolbar. But the toolbar is not showing the user control. Can you please guide me where am i going wrong.
Following is my code snippet:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim paths() As String
'Dim TaggerTemplate As TaggerTemplate
Dim tlbBtn As RadToolBarButton
tlbBtn = New RadToolBarButton("Tagger")
tlbBtn.ItemTemplate = New TaggerTemplate()
RadFileExplorer1.ToolBar.Items.Add(tlbBtn)
'TaggerTemplate = New TaggerTemplate
'Dim item As RadToolBarItem = tlbBtn
'TaggerTemplate.InstantiateIn(item)
'item.ItemTemplate = New TaggerTemplate()
'RadFileExplorer1.ToolBar.DataBind()
End Sub
Public Class TaggerTemplate
Implements ITemplate
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
Dim tagger As CtrlTagger
tagger = New CtrlTagger
tagger.ID = "TagItem"
' container.Controls.Add(tagger)
Dim wrapperDiv As HtmlGenericControl = New HtmlGenericControl("DIV")
wrapperDiv.Controls.Add(tagger)
container.Controls.Add(wrapperDiv)
End Sub
End Class
I am trying to add a web user control(.ascx) in the RAD Toolbar. But the toolbar is not showing the user control. Can you please guide me where am i going wrong.
Following is my code snippet:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim paths() As String
'Dim TaggerTemplate As TaggerTemplate
Dim tlbBtn As RadToolBarButton
tlbBtn = New RadToolBarButton("Tagger")
tlbBtn.ItemTemplate = New TaggerTemplate()
RadFileExplorer1.ToolBar.Items.Add(tlbBtn)
'TaggerTemplate = New TaggerTemplate
'Dim item As RadToolBarItem = tlbBtn
'TaggerTemplate.InstantiateIn(item)
'item.ItemTemplate = New TaggerTemplate()
'RadFileExplorer1.ToolBar.DataBind()
End Sub
Public Class TaggerTemplate
Implements ITemplate
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
Dim tagger As CtrlTagger
tagger = New CtrlTagger
tagger.ID = "TagItem"
' container.Controls.Add(tagger)
Dim wrapperDiv As HtmlGenericControl = New HtmlGenericControl("DIV")
wrapperDiv.Controls.Add(tagger)
container.Controls.Add(wrapperDiv)
End Sub
End Class