|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Treeview SelectedNodeChanged event not firing--
Brad Hello - I'm having the following code to trigger when any treeview node is selected: On Page_load: this.TreeView1.SelectedNodeChanged += new System.EventHandler(this.TreeView1_Select); public void TreeView1_Select(object sender, System.EventArgs e) { string value = TreeView1.SelectedNode.Value; string path = TreeView1.SelectedNode.ValuePath; } But the Treeview1_select is not getting triggered at all. Instead when a node is clicked, a new page with the same treeview shows up. Any help is appreciated. Thanks Set the NavigateUrl property of the TreeNode to an empty string:
"The text of a node in the TreeView control can be in one of two modes: selection mode or navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the node's NavigateUrl property to a value other than an empty string (""). To put a node into selection mode, set the node's NavigateUrl property to an empty string." http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treenode(VS.80).aspx Show quoteHide quote "Brad Law" wrote: > > -- > Brad > > Hello - I'm having the following code to trigger when any treeview node is > selected: > > On Page_load: > > this.TreeView1.SelectedNodeChanged += new > System.EventHandler(this.TreeView1_Select); > > public void TreeView1_Select(object sender, System.EventArgs e) > { > string value = TreeView1.SelectedNode.Value; > string path = TreeView1.SelectedNode.ValuePath; > > } > > But the Treeview1_select is not getting triggered at all. Instead when a > node is clicked, a new page with the same treeview shows up. > > Any help is appreciated. > > Thanks > You can also control what happens when the nodes are selected with
TreeNode's SelectAction property. It accepts a TreeNodeSelectAction enum. Public Enum TreeNodeSelectAction ' Fields Expand = 1 None = 3 [Select] = 0 SelectExpand = 2 End Enum So if you want ONLY your leaf nodes to raise the Select event then set those nodes' SelectAction property to TreeNodeSelectAction.Select and set the other nodes to TreeNodeSelectAction.Expand.
Cant get user-entered values in GridView
ASP.NET, CSS, and Netscape 7.1 Fitting a character on a small button Scrolling DG w/a Fixed Header DataGrid1.DataSource = ds.Tables(2) GridView Multiple Select Buttons it's really important thing to solve How can I create a new excel file in webbrowser? Help! About the webBrowser! Dynamically adding Views to Multiview control |
|||||||||||||||||||||||