Is there some sample code available for creating a WebExplorerBar template, group and item dynamically? Or hopefully, I am missing something simple?I had this working when configured in the markup but I need to create them dynamically. Although the code runs and I can access the webdatatree from within the template, a call to WebExplorerBar1.group(0).item(0).FindControl("TemplateTest") does not return an object and even when I add nodes to webdatatree in the template, they do not show. I has hoping that as long as the templateid for the item matched the templateid of the template then they would be associated (as happens in the markup) but this is not happening. The below example code is being tested in the page_load.
Dim newGroup As New ExplorerBarGroup Dim newItem As New ExplorerBarItem
newGroup = New ExplorerBarGroup newGroup.Text = "Group Text" newGroup.Value = "Group Value"
newItem = New ExplorerBarItem newItem.TemplateId = "TemplateTest"
newGroup.Items.Add(newItem)
WebExplorerBar1.Groups.Add(newGroup)
Dim ExplorerBarTemplate As New ItemTemplate
Dim wdt As New Infragistics.Web.UI.NavigationControls.WebDataTree
wdt.ID = "Test Tree"
ExplorerBarTemplate.ID = "Template ExplorerBar" ExplorerBarTemplate.TemplateID = "TemplateTest" ExplorerBarTemplate.Controls.Add(wdt)
WebExplorerBar1.Templates.Add(ExplorerBarTemplate)
Hi.
Yes, thank you for the sample. I suspect it was setting the autopostback flag that I was missing so will bear this in mind for the future. We can do everything that we need client-side so far, thus avoiding the postback.
Regards,
Andrew
Hello Andrew,
I am following up to see if the information and sample provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
Thank you for your patience. I have modified and attach the sample to demonstrate handling a server side event of the WebDataTree when it is in the template of the WebExplorerBar. To do this I used the AddHanlder in the InstantiateIn function of the CustomItemTemplate class.
Please let me know if you have any questions concerning this matter.
Thank you for your patience. I am still doing some research into this matter. This is taking longer than I originally thought, I will continue working on this matter and provide you with a progress update by Monday.
Thank you for the update. I am currently looking into this matter of handling server side events for the controls in the template item of the WebExplorerBar. I will continue working on this matter and give you a progress update by the end of the day Wednesday.