Wednesday, March 21, 2012

ComponentArt Treeview and Cascading dropdownlist

I have a ComponentArt treeview control that I add nodes to programmatically. It works fine when I place it on a page by itself, but when I place a Cascading DropDown control from the Atlas control toolkit, it seems that the treeview loses it's nodes on postback.

My treeview:

<ComponentArt:TreeViewID="TreeView1"runat="server"style="width:100%"AutoPostBackOnSelect="true"CollapseNodeOnSelect="false" ExpandNodeOnSelect="true"DragAndDropEnabled="true" CssClass="TreeView" NodeCssClass="TreeNode"HoverNodeCssClass="HoverTreeNode"SelectedNodeCssClass="SelectedTreeNode"LineImagesFolderUrl="~/images/treeview_images/lines"ShowLines="true"NodeEditingEnabled="false"DropSiblingEnabled="true"DropSiblingCssClass="DropSibling"DropChildEnabled="true"DropChildCssClass="DropChild"EnableViewState="true"ExpandDuration="0"/>

My Atlas control:


<atlas:ScriptManagerID="MyScriptManager"runat="server"></atlas:ScriptManager>
<tableborder="0"cellpadding="0"cellspacing="0"style="width:auto">
<tr>
<tdstyle="width:auto">
<atlas:UpdatePanelID="UpdatePanel1"runat="server"Mode="Conditional">
<ContentTemplate>
<asp:DropDownListID="ddlLinkMonoType"runat="server"Font-Size="9px"/><br/>
<asp:DropDownListID="ddlLinkMono"runat="server"Font-Size="9px"/>
</ContentTemplate>
</atlas:UpdatePanel>
</td>
</tr>
</table>
<MyAtlasToolKit:CascadingDropDownID="AtlasMonoTypeDDLs"runat="server">
<MyAtlasToolKit:CascadingDropDownProperties
Category="TypeName"
TargetControlID="ddlLinkMonoType"
PromptText="Please select a Monograph Type."
ServiceMethod="GetMonographTypes"
ServicePath="MonographListService.asmx"/>
<MyAtlasToolKit:CascadingDropDownProperties
Category="Name"
TargetControlID="ddlLinkMono"
ParentControlID="ddlLinkMonoType"
PromptText="Please select a Monograph."
ServiceMethod="GetMonographsByTypeID"
ServicePath="MonographListService.asmx"/>
</MyAtlasToolKit:CascadingDropDown>

I am not sure why this is happening, but when I post back (by selecting a node in the treeview, in Page.Load it recognizes the treeview existing, but there are no nodes in the collection. I have posted this at the Component Art forums, but got no response.

I'd try putting both the treeview and the atlas control in an UpdatePanel.

That might not fix it ... since it may very well be that the treeview that you're using is not Ajax/Atlas aware. I've run into *significant* problems with other 3rd party controls (including my own) because they only ever worked with full page postbacks.


Do you mean that I should try putting each of them in their own update panel? Or should I place them within a single update panel?

The ComponentArt controls are touted to be "Atlas aware" so who knows. I'll give it a try.


What happens if you don't have any UpdatePanels at all?

No comments:

Post a Comment