multi-column, editable TreeView in WPF - c#

Yeah I am looking for some C# code of a multi-column TreeView where each cell can be inline-edited and also dragging the rows is supported.
Do you have any good examples of such a custom component?

You can check out the TreeListView example, that gives you a good intro into the GridViewRowPresenter that can be used in this scenario.
http://msdn.microsoft.com/en-us/library/ms771523.aspx
This gives you multi-column and editing can easily be done with databindings in the template.
For D&D you have to look somewhere else. But probably this blog entry of Bea Costa you can adapt to you're needs http://bea.stollnitz.com/blog/?p=53.
hth,
Martin

SharpDevelop has a TreeViewEx that supports multi-column, etc...

Related

TreeView with Customized Style WPF

I have a requirement in that i need to display items of treeview in a below specified pattern. Here i have a treeview with three levels. I need custom style for all three levels. Could you please help me...
You can create a custom style for TreeViewItems and TreeView, this would give you the ability to design your own UI for the control.
The link below shows what controls you would need to style.
https://msdn.microsoft.com/en-us/library/ms752048(v=vs.110).aspx
From the image you posted, it looks pretty straight forward. You can just have your own HierarchicalDataTemplate and DataTemplate for your nodes. Take a look at example here.
However if you want a great control on node's layout and behaviour then creating a custom ControlTemplate for the TreeViewItem is your best bet. There are many nice articles over internet. May be you can follow this one here.

WPF Control Identification

Sorry but I am a newbie to WPF, I would really appreciate if you could help me-
Tag 1 in pic- Which control can I use to create a menu similar to that in the picture ? The closest I came was using a gridview within a listview but that ends up using a header for the gridview. Normal listview just highlights the entire strip and doesn't look good at all.
Tag 2 in pic // (No longer relevant, sorry)
Edit:
Looking for something simple like when using gridview with listview (as in pic below) there is automatically that standard window gradient & bevel effect etc. (As an idea, implementing it with buttons seems to cumbersome, first strip button border, then create all these effects.) So essentially anything already inbuilt in WPF.
Thanks for any help :-D !!!
ListBox or ListView are good controls to use. If it's just the 'pretty' factor you don't like, you can provide Templates to change the appearance. But functionally, ListBox and ListView provide the function of that menu.
When working with WPF, that should be your primary motivation when choose controls. What FUNCTIONS the way you want. You can always make it LOOK different with Templates, but getting the right FUNCTION is the primary goal for the control.

assign from lookupedit selected item

Is there any method like this:
product.supplier = combobox.SelectedItem as suppier
in devexpress LookUpEdit?
I believe you can use approach demonstrated in the following KB-article:
How to obtain the selected row from the LookUp editor
PS. The official DevExpress Support Center is much better than Google or Stackoverflow when you are searching anything related to DevExpress controls.

change listviewitem tooltip to balloon

is there a simple way to set the tooltip property of a listview item to be a balloon? Typically all i would do is:
Tooltip tt = new Tooltip("This is a tooltip");
tt.isBalloon = true;
but how do i do this for a listview item
You can manually show ToolTip when mouse is over certain item
check this article
There isn't an easy way to change the tooltip on a ListView. See this blog for a detailed explanation of why.
ObjectListView -- an open source wrapper around a standard WinForms ListView -- does a reasonable amount of work for you so that you can show enhanced tool tips with minimal effort on your part.
Even if you don't want to use ObjectListView, you can still look at the code to see how it is done (admittedly, in the case of tool tips, there was a lot of work done and it would be tricky to extract that work into another project)

Setting the datasource of a WPF Grid

I'm very new to WPF, and am trying to set the datasource (which the WPF Grid doesn't have as a property) of my grid to take a List. Does anyone have any code examples of how to do this. I have googled it, but can't find any really good examples.
(Oh, and can anyone suggest a good site for all round WPF Code examples?)
Thanks
If you're referring to a WPF Grid, you can't bind it to data; it's meant for layout purposes only; you might want to look into one of the controls that inherit from ItemsControl, such as ListView.
The property you'd bind your list to, is called ItemsSource.
The other control you might be thinking of is the GridView
There's also the DataGrid (Note old link) in the WPF Toolkit which implements a lot of the same functionality as the WinForms DataGridView

Categories

Resources