Search Results

Search found 536 results on 22 pages for 'treeview'.

Page 3/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to style a treeview in Expression Blend

    - by RobDemo
    (Using Expression Blend 4 RC, Silverlight 3) I have a treeview with several different item templates for different levels. When I open this project in Blend, it seems I can only really style the top-most DataTemplate (via right-click the TreeView in the Objects/Timeline view, Edit Additional Templates-Edit Generated Items (ItemTemplate) - Edit Current). How do I drill down into the level I want and edit those templates? Rob

    Read the article

  • Last node of the treeview selected node changed not working

    - by Domnic
    im using Treeview in my master page...and every node except last node get selected if i click on it and can be redirect to respond treenode page...but when i click last node of the treeview the selectednode changed event doesnt fired it just stop page load event itself(breakpoint)..... how can i solve this problem?

    Read the article

  • TreeView Control unexpected event behavior

    - by ProgNet
    Hi all, In the MSDN is writen about TreeNode that: "By default, a node is in selection mode." "To put a node into selection mode, set the node's NavigateUrl property to an empty string." "When a node is in selection mode, use the SelectAction property to specify which event or events are raised when a node is selected." "Setting TreeNodeSelectAction value TreeNodeSelectAction.Select Raises the SelectedNodeChanged event when a node is selected." Please see TreeNode Here is the problem and possibly a bug in the control: When I set the TreeNode object PopulateOnDemand value to true and call the Collapse() function on that node. Then the TreeNodeExpanded event is raised in addition to the SelectedNodeChanged event. This is in complate contradiction to what is writen in the MSDN. According to the MSDN this sould happen only if TreeNodeSelectAction Property is set to TreeNodeSelectAction.SelectExpand value. Does some know whats the cause for that? Here is the code: <asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="False" onselectednodechanged="TreeView1_SelectedNodeChanged" ontreenodepopulate="TreeView1_TreeNodePopulate"> </asp:TreeView> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string path = Server.MapPath("."); PopulateTopNodes(path); } } //MSDN : Occurs when a node with its PopulateOnDemand property set to true is expanded in //the TreeView control. protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { LoadChildNode(e.Node); } private void PopulateTopNodes(string pathToRootFolder) { DirectoryInfo dirInfo = new DirectoryInfo(pathToRootFolder); DirectoryInfo[] dirs = dirInfo.GetDirectories(); foreach (DirectoryInfo dir in dirs) { string relativePath = (dir.FullName).Replace(pathToRootFolderPrefix, ""); TreeNode folderNode = new TreeNode(dir.Name, relativePath); if (dir.GetDirectories().Length > 0) { folderNode.PopulateOnDemand = true; folderNode.Collapse(); } folderNode.NavigateUrl = ""; folderNode.SelectAction = TreeNodeSelectAction.SelectExpand; TreeView1.Nodes.Add(folderNode); } } private void LoadChildNode(TreeNode treeNode) { string d = treeNode.NavigateUrl; string action = treeNode.SelectAction.ToString(); string fullPath = Path.Combine(pathToRootFolderPrefix, treeNode.Value); DirectoryInfo dirInfo = new DirectoryInfo(fullPath); DirectoryInfo[] dirs = dirInfo.GetDirectories(); foreach (DirectoryInfo dir in dirs) { string relativePath = (dir.FullName).Replace(pathToRootFolderPrefix, ""); TreeNode folderNode = new TreeNode(dir.Name, relativePath); if(dir.GetDirectories().Length>0){ folderNode.PopulateOnDemand = true; folderNode.Collapse(); } folderNode.NavigateUrl = ""; folderNode.SelectAction = TreeNodeSelectAction.SelectExpand; treeNode.ChildNodes.Add(folderNode); } } //MSDN:Occurs when a node is selected in the TreeView control. protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e) { } Thanks

    Read the article

  • Treeview nodes won't highlight using PopulateOndemand

    - by DrybLrac
    Hi everyone, I have a treeview and I want to highlight (change the text color) of a node in the treeview once that node has been selected. This isnt working for me for some reason. when I select a node nothing happens, but when I click the plus on the same node I just selected...it highlights...and even then when I click any of the childnodes, nothing happens and the root node stays highlighted always. Can anyone point me in the right direction...I'm using c#.

    Read the article

  • Display Hierarchial data in treeview using xml?

    - by RAMA KRISHNA
    i need to dispaly the hierarchial data in TreeView. Which is getting from sql server into to the dataset in the form of [ID],[Name],[parentID]. create the Relation on the DataSet and generate the xml by using the xslt i want to bind it to the Tree i can able to do it for the menu control but not for the TreeView.

    Read the article

  • treeview dynamically populated

    - by Laziale
    Hello everyone - I have this treeview control where I want to put uploaded files on the server. I want to be able to create the nodes and the child nodes dynamically from the database. I am using this query for getting the data from DB: SELECT c.Category, d.DocumentName FROM Categories c INNER JOIN DocumentUserFile d ON c.ID = d.CategoryId WHERE d.UserId = '9rge333a-91b5-4521-b3e6-dfb49b45237c' The result from that query is this one: Agendas transactions.pdf Minutes accounts.pdf I want to have the treeview sorted that way too. I am trying with this piece of code: TreeNode tn = new TreeNode(); TreeNode tnSub = new TreeNode(); foreach (DataRow dt in tblTreeView.Rows) { tn.Text = dt[0].ToString(); tn.Value = dt[0].ToString(); tnSub.Text = dt[1].ToString(); tnSub.NavigateUrl = "../downloading.aspx?file=" + dt[1].ToString() +"&user=" + userID; tn.ChildNodes.Add(tnSub); tvDocuments.Nodes.Add(tn); } I am getting the treeview populated nicely for the 1st category and the document under that category, but I can't get it to work when I want to show more documents under that category, or even more complicate to show new category beneath the 1st one with documents from that category. How can I solve this? I appreciate the answers a lot. Thanks, Laziale

    Read the article

  • wpf treeview does not show child objects

    - by gangt
    I have an object with child object(s) and I load it using linq. And I assign it to a treeView's itemssource. treeView.DisplayMemberPath = "Name"; treeView.ItemsSource = tasks; It shows only the parent nodes (task.name), I couldn't figure out how to add children (TaskItems.name). All the examples show HierarchicalData in xaml. I need to do it in code-behind, just like the above code. Is it possible? public class Task { public int Id; public string Name; public bool IsActive; public List<TaskItem> TaskItems = new List<TaskItem>(); } public class TaskItem { public int TaskId; public string Name; public string Value; } -------------- var tasks1 = from t in xd.Descendants("taskheader") select new Task { Id = (int)t.Element("id"), Name = t.Element("name").Value, IsActive = t.Element("isactive").Value == "1", TaskItems = t.Elements("taskdetail").Select(e => new TaskItem { TaskId = (int)e.Element("taskid"), Name = (string)e.Element("name"), Value = (string)e.Element("value"), }).ToList() }; -------------- List<Task> tasks = new List<Task>(); tasks = tasks1;

    Read the article

  • How Do I Create Expand All and Collapse All Links Outside of the jQuery Treeview Plugin?

    - by Ben Griswold
    The jQuery Treeview Plugin adds Collapse All, Expand All and Toggle All links to the "treeviewcontrol" div when the control property is defined as follows: $("#black, #gray").treeview({ control: "#treecontrol", persist: "cookie", cookieId: "treeview-black" }); This works great, but I'd like the ability to expand and collapse the treeview from other page elements outside of the treeview itself. I've looked at the source, but I can't figure it out.

    Read the article

  • WPF TreeView databinding to hide/show expand/collapse icon

    - by Julian Lettner
    I implemented a WPF load-on-demand treeview like described in this (very good) article. In the mentioned solution a dummy element is used to preserve the expand + icon / treeview item behavior. The dummy item is replaced with real data, when the user clicks on the expander. I want to refine the model by adding a property public bool HasChildren { get { ... } } to my backing TreeNodeViewModel. Question: How can I bind this property to hide/show the expand icon (in XAML)? I am not able to find a suitable trigger/setter combination. (INotifyPropertyChanged is properly implemented.) Thanks for your time. Update 1: I want to use my property public bool HasChildren instead of using the dummy element. Determining whether or not an item has children is somewhat costly, but still much cheaper than fetching the children.

    Read the article

  • WPF Treeview contextmenu IsChecked binding MVVM

    - by BrettRobi
    I've got a TreeView to which I associate a ContextMenu. That contextmenu has an item whose IsChecked property I want to bind to my ViewModel. Since I am using a tree each treeitem is bound to a subproperty of my ViewModel. In the VS2010 output window I am seeing this databinding error: BindingExpression path error: 'IsAutoStart' property not found on 'object' ''HostMgmtViewModel' (HashCode=12565727)'. BindingExpression:Path=IsAutoStart; DataItem='HostMgmtViewModel' This clearly shows it is trying to bind to my ViewModel and not to the treeitem's associated data. How do I bind to the correct object? Remember my contextmenu is associated with the whole TreeView not to the specific treeitem.

    Read the article

  • To get the parent node of a treeview in the TreeViewDragDropTarget in Silverlight

    - by Ramya
    Hi, I have created a TreeViewDragDropTarget like this, <controlsToolKit:TreeViewDragDropTarget msWindows:DragDrop.AllowDrop="False" ItemDroppedOnTarget="TreeViewDragDropTarget_ItemDroppedOnTarget" ItemDragCompleted="TreeViewDragDropTarget_ItemDragCompleted" AllowedSourceEffects="Copy"> <controlsToolKit:TreeViewDragDropTarget.Resources> <common:HierarchicalDataTemplate x:Key="hierarchicalTemplate" ItemsSource="{Binding ChildNode}"> <TextBlock Text="{Binding MainText, Mode=TwoWay}" TextWrapping="Wrap"/> </common:HierarchicalDataTemplate> </controlsToolKit:TreeViewDragDropTarget.Resources> <controls:TreeView x:Name="MainTreeView" BorderThickness="1" ItemTemplate="{StaticResource hierarchicalTemplate}" Background="Transparent" Cursor="Hand" BorderBrush="{x:Null}" VerticalAlignment="Top"/> </controlsToolKit:TreeViewDragDropTarget> All I am doing is dropping some text into the nodes of the treeview. I want to find the parent node of the drop target. How do I do it?

    Read the article

  • WPF TreeView drag and drop using preview

    - by imekon
    I'm handling drag and drop events in a TreeView using PreviewMouseDown, PreviewMouseMove and PreviewMouseUp, however, there is an issue. In my PreviewMouseDown handler, I set everything ready in case there's a drag started (detected in the Move event), however I set e.Handled = true. This means that standard selection events don't get generated on my tree! What I want to be able to do in my Up event is to invoke the standard treeview selection changed event - except I cannot call events outside of the tree. So what's the correct way to do this? I have tried using the standard MouseDown, MouseMove and MouseUp events however there's an issue with messing up my multiple selection feature that means I need to use the Preview version of those events.

    Read the article

  • PopulateOnDemand does not work on data bound ASP.Net TreeView

    - by Shay Friedman
    Hi, I have a TreeView that is bound to a XmlDataSource control. I've added some TreeNodeBinding elements to define how I want the XML data to be shown. I have also added PopulateOnDemand=true to these TreeNodeBindings. However, doing so didn't change a thing and the entire XML tree is displayed. Moreover, the TreeNodePopulate event is not fired on node expand as well. Important information: I'm using ASP.NET 4. This is an example that reproduces the problem (very straight forward): <%@ Page Language="C#" AutoEventWireup="true" %> <script type="text/C#" runat="server"> protected void TreeView1_TreeNodePopulate(Object sender, TreeNodeEventArgs e) { // This method is never called... } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1" OnTreeNodePopulate="TreeView1_TreeNodePopulate" ExpandDepth="0"> <DataBindings> <asp:TreeNodeBinding DataMember="#" TextField="#" ValueField="#" PopulateOnDemand="true" /> </DataBindings> </asp:TreeView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="Sample.xml" /> </div> </form> </body> </html> The Sample.xml can be any xml file you want, it doesn't really matter. I tried to put a breakpoint within the TreeView1_TreeNodePopulate method and it was never hit. I also tried to: Set a TreeNodeBinding for each possible data member with PopulateOnDemand="true". Via code, go through all tree nodes and set their PopulateOnDemand property to true. Nothing worked. The only way the populate-on-demand thing worked was when I added nodes manually to the nodes instead of binding it to a data source. What am I doing wrong?

    Read the article

  • Recursive TreeView in ASP.NET

    - by waqasahmed
    I have an object of type list from which I wish to use to populate a treeview in asp.net c#. Each object item has: id | Name | ParentId so for example: id | Name | ParentId ------------------------- 1 | Alice | 0 2 | Bob | 1 3 | Charlie | 1 4 | David | 2 In the above example, the parent would be Alice having two children Bob and Charlie. David is the child of Bob. I have had many problems trying to dynamically populate the treeview recursively in c# ASP.NET Does any one have a simple solution? Btw: you can use People.Id, People.Name and People.ParentId to access the members since it is an object belonging to list. I can post you my code so far (many attempts made) but not sure how useful it will be.

    Read the article

  • Recursive TreeView in C# ASP.NET

    - by waqasahmed
    I have an object of type list from which I wish to use to populate a treeview in asp.net c#. Each object item has: id | Name | ParentId so for example: id | Name | ParentId 1 | Alice | 0 2 | Bob | 1 3 | Charlie | 1 4 | David | 2 In the above example, the parent would be Alice having two children Bob and Charlie. David is the child of Bob. I have had many problems trying to dynamically populate the treeview recursively in c# ASP.NET Does any one have a simple solution? Btw: you can use People.Id, People.Name and People.ParentId to access the members since it is an object belonging to list. I can post you my code so far (many attempts made) but not sure how useful it will be.

    Read the article

  • How to select certain child node in TreeView, C#

    - by Caslav
    I am having a problem with selecting a certain child node. What I want to achieve: I you have this treeview for example (one parent with two child nodes): Parent -Child with a value 5 -Child with a value 2. I want to add these two values and assign them to Parent node: Parent result 7 -Child 5 -Child 2. Of course, a bigger treeview would have several parents and lots of children and they will all add up to one root node. How can I do this?? pls help. thx, Caslav

    Read the article

  • Changing the itemsSource of a treeview makes it's children invisible, when they were already display

    - by Marnix Kraus
    I found some strange problem in WPF, using the itemsSource of a treeview. I hope I can make this specific problem clear for you. First; a story. There is a treeview. It has a list with treeviewitems as itemsSource. This list is called _roots. There is another list, called _leafs. For as in a treeview, the _roots contain the _leafs in some hierarchical way. For example: <TreeviewItem Header="Jungle"> <TreeviewItem> <SpecialTreeviewItem Header="Monkey"/> <SpecialTreeviewItem Header="Apple"/> </TreeviewItem> </TreeviewItem> Now I am trying to switch between these two lists as itemsSource. It seemed to work fine, but it doesn't: When the Jungle-item is un-expanded, and I change the itemsSource to _leafs, and change it back again to _roots, everything works fine and all items can be expanded and showed. But when the Jungle-item is expanded (and the special items are already visible) and I change it to the _leafs itemsSource, and then change the itemsSource back to _roots, all special items have disappeared!! Also, when I do the same as case 2, but first un-expand the Jungle-item again, the special items also disappear. I did a lot of debugging, before posting this question here and come to the following conclusion: Printing on the event: visibility changed, the visibility is set to false for all items that were already visible (that is, when _roots become visible, the special items become invisible (because they were already visible)) So, IsVisible is false for the items, but Visibility = Visible. Which is a bit strange. The problem seems to depend on the use of the _roots list, which in a certain way contain the _leafs. When I change the itemsSource to different lists with special items in it, everything works fine. The hierarchical structure of the _roots make this thing broken. I hope that this is a complete overview of my problem. Help would be appreciated.

    Read the article

  • Three State Treeview Windows Forms

    - by alhambraeidos
    Hello everybody people, One of the frustrations with the standard TreeView is that you can't show a partial selection to indicate that some of the children are selected. A partial selection in a complex tree allows the user to easily determine where the selections are, even if the tree is not completely expanded. A similar idea is used in manu backup programs to allow the user to select the files to be backed up. Does anyone know of a way to make the checks in a treeview checkbox gray? I want to gray the check of a parent node when some (but not all) of its child nodes are checked. Kinda like what you see when you are selecting options to install during a software installation. I have seen several post, but is older (2000, 2007 year). I now, in 2010, the better answer possible is required. I use VS 2008 . Net 3.5 , Windows Forms Thanks in advanced, greetings

    Read the article

  • TreeView binding issue in WPF

    - by Michael Stoll
    Consider the following data structure: List<Person> People; class Person { List<Car> Cars; List<Hobby> Hobbies; } I want to bind a TreeView to this structure. And it should look like this: People > Frank > Cars > BMW > Ford > Hobbies > Tennis > Golf > Jane > Cars > Hobbies How can this be achieved in XAML? This is a follow up question to binding-a-treeview-with-contextmenu-in-xaml

    Read the article

  • Multiple selection in a TreeView

    - by Frederick
    I am using a Windows Forms TreeView control in my program. I would like to allow the user to select multiple nodes at the same level by dragging their mouse pointer around (also called a "lasso" selection). I don't think a standard TreeView allows that. My question is what would be the best way to achieve this? Do I have to write custom selection behaviour of my own in perhaps a custom or derived control? Where do I start? I don't need a detailed explanation. Just a small nudge in the right direction.

    Read the article

  • [.net] Treeview prevent Node collapse (weird problem)

    - by cssnoob
    Hey guyz! I have a .net 2.0 C# Project. I have a Treeview with 2 Nodes, each of them has many child nodes. When you click on a child node, a PDF is displayed in a webbrowser control depending on the properties of the node. Fine, but the problem is that when both Nodes are expanded, and I click on a child node, the other node gets collapsed! I don't have any code that collapses any node of the treeview, but somehow it happens! I also had a look at the BeforeCollapse Event, but somehow it doesn't fire, alltough the other node collapses! Can anyone imagine why this happens? I would be very grateful if anyone can teach me how to prevent this happening! Thank you very much!

    Read the article

  • Treeview remove property problem

    - by curiosity
    Hi, i added a SampleNode to the treeview. if i remove any node from SampleNode, like, TreeNode[] nodes = this.SampleNode.Nodes.Find(node.Text, true); if (nodes.Length > 0) { int j = nodes[0].Index; if (nodes.Length > 0) this.SampleNode.Nodes[j].Remove(); } it is deleted in treeview but not in SampleNode. Why does this happens? what is the solution?

    Read the article

  • building treeview

    - by DJPlayer
    I'm dynamically building a treeview given numerous stored procedures. the structure goes like this: OwnerRPColl.Search2() For Each root As OWNER_RP In OwnerRPColl Dim nd_Root As New TreeNode nd_Root = TreeView1.Nodes.Add(root.OWNER_RP_BUSNS_NAME) bldg.ID = root.ID bldgColl.Search(bldg.ID) For Each firstChild As BLDG In bldgColl Dim nd_lvl_One As New TreeNode With nd_lvl_One .Text = firstChild.BLDG_NAME_1 .Tag = firstChild.ID End With problem being is that I need to have labels for these.. meaning the first level of the treeview needs to say "users" when expanded displays users. Each of these users can have a building. The world building needs to be the example option, which then displays the building.. essentially I need a slick way to add the word in for the expanding level (instead of the value in the collection).

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >