locked
Node selection problem in cssAdapter tree view RRS feed

  • Question

  • User-262822995 posted

    If navigate url proprty is specified, page is not post backed and selected node is not getting highlighted

    Friday, January 4, 2008 7:19 AM

All replies

  • User-2006632406 posted

    Just to help viewers to provide solution - I am adding few lines from .aspx & .cs, when we select Treenode 'Machine' - it gets selected but 'Assembly1' does not.

    TreeView.aspx

    <asp:TreeView ID="TreeView1" runat="server" ShowLines="true"

    CssSelectorClass="PrettyTree" OnSelectedNodeChanged="OnTreeSelection" OnAdaptedSelectedNodeChanged="OnTreeSelection">

    <Nodes>

    <asp:TreeNode Text="Machine"

    Value="Machine1" ImageUrl="~/Images/Assembly.bmp" Expanded="false">

    <asp:TreeNode Text="Assembly 1" Value="Assembly1" ImageUrl="~/Images/Assembly.bmp" NavigateUrl="~/imgPlaceHolder.aspx" Target="RightFrame">

    <asp:TreeNode Text="Component A1" Value="ComponentA1" ImageUrl="~/Images/Component.bmp">

    </asp:TreeNode>

    </asp:TreeNode>

    <asp:TreeNode Text="Component 1" Value="Component" ImageUrl="~/Images/Component.bmp">

    </asp:TreeNode>

    </asp:TreeNode>

    </Nodes>

    <SelectedNodeStyle CssClass="AspNet-TreeView-Selected" />

    </asp:TreeView>

     

    TreeViewAdapter.cs

    public void RaisePostBackEvent(string eventArgument)

    {

    ...

    if (selectedNode != null)

    {

    bool bSelectedNodeChanged = selectedNode != treeView.SelectedNode;

    ClearSelectedNode(items);

    selectedNode.Selected = true;

    ...

    }

    }

     

     

    Thursday, January 10, 2008 4:44 AM