I'm writing a WPF app to load XML into the WebBrowser control (via the Navigate method) and also populate a Treeview with the XML nodes. I have managed to do both of these without issue but what I need to do now is find and scroll to the node in the WebBrowser when I double click a particular node or element in the TreeView.
I suspect I can use XPath with a Javascript or DOM query but apart from that idea I have no idea to do what I need or if, once the node is found in the XML whether I can get the webbrowser control to scroll to it. I've googled this for ages but can't see anything so far that shows me how to do this - can anyone point me in the right direction please?
Related
I am trying to display a div element in winform solution, searching for good control from the basic/devexpress controls to display div elements but I can't find any.
is there any idea how I can display the dev elements without using web browser control
Consider a large TreeView; some nodes and subnodes are expanded others are collapsed. The user adds a child node to a node and the program saves everything back to the underlying XML file. Then the TreeView rebuilds. The problem is that only the root node is expanded; all other nodes are collapsed.
Has anybody ever seen code (I don't think there's anything built into WPF that does this) that saves the state of the TreeView (which nodes are expanded) and then is able to restore it to this state after a save?
Any ideas?
Edit
Well, that link didn't really help. I'm thinking of creating an array and storing the state of isExpanded and then reading it back after the load.
One has to manage the treeview's states directly and note when a node is expanded or collapsed. Then on load or refresh, open / close the nodes as needed.
I am working on a windows form application, where I connect to the database and get a list of projects and sub-projects. I am able to show this as a treeview with checkboxes, that later an user can select to do further operations.
My problem is that, I can't set the Parent node state when one of the child nodes is selected. Here, I want some indication, if any of the child nodes is selected the parent node should fill in to show that something has been selected below that parent node.
Okay, meanwhile, I found answer to my problem. Not really wise but thanks to this Simple Tri-State TreeView control. code link here.
I will definitely try to build my own custom version of this. For now, this works fine.
I want to add a link beside the node text in treeview. like the following figure:
After some googling, I found that there's no NodeTemplate in the treeview and creating the node text manually like this sample is the only way.
The only problem I have is that the built-in selection functionality isn't worked anymore, because the internal javascript select function isn't called.
Any idea about a workarround or another way to implement my goal?
Have you tried RenderPostText?
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treenode.renderposttext.aspx
http://kb.cnblogs.com/a/1379715/
I am using the standard asp.net treeview control to display a menu structure that is getting bound from a database. The data structure has a parentID column to represent the node relationship if one exists.
Anyway, that's not an issue, I am looking for a treeview control that would allow a user to rearrange the node by dragging them to a new position within the tree. Can anyone point me in the right direction as to any controls out there that can do this? The windows form control has the move node events. IS there something like this for web forms? Any pointers greatly appreciated.
You can have look at ExtJS TreePanel.
Drag and Drop ordering in a TreePanel
Why not try the JQuery TreeView plug-in?
http://plugins.jquery.com/project/treeview
Not sure if meets all of your non-functional requirements, but if you click on the "Try out a demonstration" link, you should be able to see if it meets your needs.