Question

Je suis en train de se SelectedNodeStyle à travailler avec NavigateUrl sans succès. Le style n'est pas appliquée en cliquant sur les nœuds.

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

Création Noeud:

                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

Toutes les suggestions?

Était-ce utile?

La solution

Avez-une solution de contournement. TreeNode.Value utilisé au lieu de TreeNode.NavigateUrl et utilisé l'événement TreeView.SelectedItemChanged pour faire la navigation réelle.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top