|
Thanks for the tip, Dmitriy. I'll add this to my growing list.
|
|
|
|
|
Good job on your control. I really like it.
I have one problem with the colors for the subitems. When I set the BackColor property, the color is not right : it is the same color, but washed out. Is it a bug or how can I get the right color. The ForeColor property gets me the right color.
Also, when I set the text alignment for the subitems, there seems to be a problem with the HorizontalAlignment.Center or the HorizontalAlignment.Right setting. Sometimes, I cannot see the whole string inside the subitem.
Thank you
Frank
|
|
|
|
|
You are right about the washed out color - it's definitely a bug. I'll look into the alignment issue, but this sounds like a bug as well.
|
|
|
|
|
I think the problem with the Text Alignment lies in the MeasureDisplayString method in the Tools.vb file.
If you change it to:
Public Shared Function MeasureDisplayString(ByVal aGraph As Graphics, ByVal aText As String, ByVal fontVal As Font) As SizeF
Dim Bmap As Bitmap = New Bitmap(1, 1, aGraph)
Dim Anagra As Graphics = Graphics.FromImage(Bmap)
Dim Sz As SizeF = aGraph.MeasureString(aText, fontVal)
Bmap.Dispose()
Anagra.Dispose()
Return Sz
End Function
Then the Text Alignment works better.
|
|
|
|
|
How are things coming on the washed out subitem bug? It is a show stopper for me at the moment.
Karl
|
|
|
|
|
first of all thanks for the the source. I am trying to build up a view like filezila's upload and download GUI. which is basicly adds lots of files into listview and upload or download them. for this I think 2 column will be enough for one filename and second for the progressbar to show how is it going. actually I did it and working nicely. but I need to put 3 columns into ContainerListView. otherwise my progressbars does not show up. I dunno where am I doing wrong.
any idea ?
|
|
|
|
|
How would i programatically expand the columns similar to double clicking on the column headers but not. This expanding should be large enough that both the header text AND the columns content are all visble.
In short i would like to adjust all the columns widths as the tree gets expanded. So that at all times all text is (all text thats expanded anyway) is visble to the user.
Thanks for a great control
Ps. I tried a hack that ive used on the default listviews and it doesnt work. Any help is appriciated!!
For Each col As WinControls.ListView.ContainerColumnHeader In Clv.Columns
col.Width = -3
Next
|
|
|
|
|
Hello,
great control but i get an error when i add a column.
Errors in the code generation for the nodes-property. Error: TreeListNodeConverter can not
convert WinControls.ListView.TreeListNode into
System.ComponentModel.Design.Serialization.InstanceDescriptor.
i use VB 2005 Express
thanks for help
|
|
|
|
|
Hi,
If i have two sibling and the former has many child nodes ( more than what
the screen can hold, the lines that link to the next sibling node does shows only when the sibling node comes into view.
Also, your help files does not show the class hirarchy charts between the various classes. I'm unable to understand the relation between ContainerListViewItem and TreeListNode.
I'm implementing a search box on the tree. If a user types in it, it will seach and highlight all the matching nodes. I need to expand all the parent nodes of the matched nodes and present it to the user. I'm maintaining a hashtable of all the nodes since its easier to search thru the list. How ever, after i'v expended all the required nodes, and scroll using the scroll bar to the bottom, i get a null exception. The Code is a follows:
Public Sub SelectNodes(ByVal txt As String, ByRef nodecount As Integer)
Dim nds() As TreeListNode
nodecount = 0
For Each node As TreeListNode In _nodesByValueMember.Values 'Hashtable
node.BackColor = Color.White
If node.Text.ToUpper.StartsWith(txt.ToUpper) And txt <> "" Then
' node.leaf is a property added by me. I need to differentiate between Groups: can have child nodes and Leafs: Terminal Nodes.
If (LeafOnly And node.Leaf) Or Not LeafOnly Then
node.BackColor = Color.Green ' highlight the node
nodecount += 1
If node.Text <> node.FullPath Then 'has parents
'(node.hasparent=false, did not work here)
nds = node.ParentNode.GetNodesInPath()
For i As Integer = 0 To nds.Length - 1
If Not nds(i).IsExpanded Then nds(i).Expand()
Next
End If
End If
End If
Next
End Sub
thanks,
|
|
|
|
|
Hi,
I've tried your control.
It's very good.
But I have changed default font and i get items in TreeListView in the original control font.
I have also derived a form from my base form which has Calibri as default font.
Then i have dragged TreeListView control on the form but the control font remains TreeListView default font and not the base form default font.
Happens it only to me?
Thanks in advance
Bye
Gianluca
|
|
|
|
|
Gianluca,
I'll look into this soon. Thanks for the update.
|
|
|
|
|
Gianluca - Dragging onto a base form will not change the font. You will have to do it manually. Also, I cannot reproduce the problems changing the font in the treelistview as it seems to be working for me. Can you send me a small sample recreating the error?
|
|
|
|
|
Hi,
I have recompiled all the projects of my solutions with Visual Studio 2008 / .Net 3.5 and now it works.
For your information this is how i have used your TreeListView
- I have a standard form called Base (with Default font Calibri, 11 bold). This form has been compiled as a library (dll).
- I have created a form (named Main) derived from Base where i have inserted your control TreeListView.
- I have manually changed the font for TreeListView in Calibri, 11 bold from standard Visual Studio WinForm Designer (property font).
In Visual Studio 2005 the first row of the control (column headers) is in Calibri 11 Bold but 2nd, 3rd, ... rows are in another font.
With Visual Studio 2008 / .Net 3.5 it's ok
Thanks for the control
Bye
Gianluca
|
|
|
|
|
This is an excellent control. Thanks for sharing.
I noticed that when you set backcolor property for TreeListNode and your tree list view has a horizontal scrollbar, scrolling horizontally scrolls the background color of the node as well.
|
|
|
|
|
Thanks for the finding the bug. I'll add it to the list and get to it soon, hopefully. Right now I'm swamped with work. If you happen to fix it before I do let me what did the trick. Thanks!
|
|
|
|
|
Great component, But very damage that the data cannot be typed, (Integer, Boolean, Dates, ...)
How to select the data body for some to do a copy, in laquel a single column changes value before final copy?
Thank you a lot
Claude Excuse my English, a French
|
|
|
|
|
Great suggestion on the typed data! I'll get that in a future release.
I'm not sure if I understand what you are saying about the copy. Can't you add your own ContextMenuStrip on the control with selection options? Does this answer your question?
|
|
|
|
|
I used this control on a database, and I want to be able to do a copy of the body of the nodes and subitems, next put back them in entirety in having to change only the value of a column (fields ref DB)
|
|
|
|
|
|
As I use this superb component with a database, I have of the to modify this component at the level of the classes, For the under nodes (Listview) not need of icon and it lacked me 3 property ,(
Key,Value,WithImage, (of a column))
Claude
|
|
|
|
|
Claude,
Sorry, but i'm still not sure what you are getting at here.
|
|
|
|
|
The control looks pretty good man. I'm glad people are still working on these controls, as I have had such a hard time finding time to do any personal projects. I would love to dive back in and rewrite my original controls, but I don't think it will ever happen. Keep up the good work, and keep the project alive.
|
|
|
|
|
Your article was my inspiration to get it started and extend it. I looked at several other attempts at TreeListView controls but all of them were either underdeveloped or very buggy. So I took your design as the base and decided to merge all of the good aspects of the other controls (as well as my own ideas) into one control! I tried to keep it as extensible as possible so others could build on top of it easily if necessary. I've actually had this control since 2004 (working on it here and there) but, unfortunately, my aversion to writing articles and my lack of any free time (2 kids, full time job as well as maintaining a small side business) for personal projects actually kept me from posting it on CodeProject but I finally mustered up enough motivation to post it here.
Thanks for your original article. If it wasn't for that I probably never would have started it.
|
|
|
|
|
But you may want to look at the performance.
When you add say 500, 1,000 or even 5,000 nodes the control works well, but when you add 10,000 the control becomes sluggish and slow to respond.
Other than that, very well done!
I think this control will be very useful and has great potential.
Kind regards
Gary
|
|
|
|
|
Thanks! I'll check it out and hopefully get it fixed.
|
|
|
|