views:

14

answers:

1

I'm trying to get SelectedNodeStyle to work with NavigateUrl without success. The style is not applied when clicking on nodes.

            <asp:TreeView ID="treeviewSIP" runat="server" ExpandDepth="0">
                <SelectedNodeStyle BackColor="Red" ForeColor="WhiteSmoke" 
                    BorderStyle="Solid" BorderWidth="1px" BorderColor="#66FF33">
                </SelectedNodeStyle>
            </asp:TreeView>

Node creation:

                With nyNode
                    .NavigateUrl = "thePage.aspx?op=visa&Tabell_ID=" + viewSIP.Item(sipIndex)("TABELL_ID").ToString
                    .Target = "main"
                    .Text = viewSIP.Item(sipIndex)("NAMN")
                    .SelectAction = TreeNodeSelectAction.Select
                    theParent.ChildNodes.Add(nyNode)
                End With

Any suggestions?

A: 

Did a workaround. Used TreeNode.Value instead of TreeNode.NavigateUrl and used the TreeView.SelectedItemChanged event to do the actual navigation.

jgauffin