V 3 TreeView much improved, but . .

Posted by: kbj on 5 November 2017, 5:47 pm EST

    • Post Options:
    • Link

    Posted 5 November 2017, 5:47 pm EST

    In a simple app, scrolling the treeview or resizing the from slows to a crawl based on the number of items in the treeview. The below app, which contains 3,000 nodes (not a huge amount) illustrates the problem. This is true with bound and unbound examples.

    Make a simple 1 form solution, add a c1Treeview named ‘tv’ (set dock to fill) then paste the code below.

    Imports System.ComponentModel

    Public Class Form1

    Private things As New BindingList(Of classThing)

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

    tv.ScrollBars = ScrollBars.Both

    For i = 1 To 1000

    Dim thing As classThing

    thing = New classThing(“First thing”, “1”)

    things.Add(thing)

    Dim child = New classThing(“Child thing”, “2”)

    thing.add(child)

    Dim grandchild = New classThing(“Grandchild thing”, “3”)

    child.add(grandchild)

    Next

    tv.DataMember = “\children\children”

    tv.DataSource = things

    tv.ExpandAll()

    End Sub

    End Class

    Public Class classThing

    Public Property title As String

    Public Property id As String

    Public Property children As BindingList(Of classThing)

    Public Sub New(_title As String, _id As String)

    title = _title

    id = _id

    End Sub

    Public Overrides Function tostring() As String

    Return title

    End Function

    Public Sub add(_thing As classThing)

    If children Is Nothing Then children = New BindingList(Of classThing)

    children.Add(_thing)

    End Sub

    End Class

  • Posted 6 November 2017, 2:49 am EST

    Hello,

    We too could observe the same at our end, hence this issue has been escalated to the development team for fix {Tracking ID: 295397}.

    We would update you once it is fixed/ we receive any information from the developers.

    Regards,

    Ruchir Agarwal

  • Posted 8 November 2017, 6:11 pm EST

    Hi,

    Any idea on the timeframe for the fix? The TreeView control is unusable with as few as 200 nodes (slow scrolling, very slow redrawing)

    I’m on pins & needles,

    Kingman

  • Posted 9 November 2017, 4:09 am EST

    Hello,

    Understanding the criticality of this issue for you, though our development team is busy with the upcoming release (scheduled for mid November),we have increased this case’s Priority and have asked them to take this case on Priority.

    We would update you, as soon as we receive an ETA for the fix.

    Regards,

    Ruchir Agarwal

  • Posted 9 November 2017, 7:08 pm EST

    Another anomaly is that when you change the treeview NodeCellStyle (say for tv.Styles.Hot) on a treeview with expanded nodes, hidden nodes (that have never been visible) reflect the new style, while previously loaded nodes’ colors do not change . . .

    So, what I am asking, is how to change the tv.Styles.Hot for all nodes on an active treeview?

    Thanks

  • Posted 10 November 2017, 4:55 am EST

    Hello Kingman,

    If we understand you properly, you wish to change the tv.Styles.Hot for all nodes. If it is so, then we would like to inform you that the just by modifying the tv.Styles.Hot.* upon a Button_Click we were able to observe the changes for all the nodes of the TreeView.

    However, if we are missing anything here, could you please share a video of the issue you are facing.

    Thanks,

    Ruchir Agarwal

  • Posted 10 November 2017, 12:01 pm EST

    Hi Ruchir,

    The problem may have to do with the treeview being themed. Using the below 1 form project project with a c1treeview, button and a c1ThemeController:

    [b]Imports C1.Win.C1Themes

    Imports C1.Win.TreeView

    Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

    C1ThemeController.ApplicationTheme = “Office2010Blue”

    C1TreeView1.Styles.Default.BackColor = Color.Red

    C1TreeView1.Styles.Default.ForeColor = Color.Blue

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    C1ThemeController.ApplicationTheme = “ExpressionDark”

    C1TreeView1.Styles.Default.BackColor = Color.Blue

    C1TreeView1.Styles.Default.ForeColor = Color.Aquamarine

    Dim newNode = New C1TreeNode

    newNode.SetValue(“New node”)

    C1TreeView1.Nodes(2).Nodes.Add(newNode)

    End Sub

    End Class[/b]

    I observed:

    Note that the original nodes backcolor does not change and the forecolor reverts to the themes forecolor for a treeview, and that the newly created and added node is displaying correctly.

    On further investigation,an un-themed treeview has the same problem, so please post an example that works.

  • Posted 13 November 2017, 3:28 am EST

    Hello,

    Thank you for sharing the screen-shots and the code-snippet.

    We could now see the issue, hence the same has been escalated to the concerned team for fix {Tracking ID: 296641}.

    Regards,

    Ruchir Agarwal

  • Posted 13 November 2017, 10:46 am EST

    There is another odd behavior . . .A treeview with scrollbars set to ScrollBars.Both only shows only the vertical scrollbar

    Note that the second node is wider than the control . . .

  • Posted 14 November 2017, 2:04 am EST

    Hello,

    Thank you for reporting this issue.

    It has been forwarded to the concerned team for fix {Tracking ID: 296925}. We will update you once it is fixed.

    Regards,

    Ruchir Agarwal

  • Posted 14 November 2017, 9:42 am EST

    Hello,

    We have received following response from the developer:

    It’s not a bug.

    C1TreeView stretches last column height to left ClientRectangle border.

    But you can set the AutoWidth property of C1TreeColumn as true for scrolling content by horizontal.

    Do let me know if you have any concerns with this.

    ~Ruchir Agarwal

  • Posted 14 November 2017, 12:42 pm EST

    Changing the treecolumn autowidth property to true causes 2 significant problems.

    1.The horizontal scroll width expands to a width to accommodate all nodes (even if the nodes are not visible)



    and (this is the important one) when you click on a node, the controls automatically scrolls to where the leftmost character in the text displayed on the node is aligned with the left edge of the control

    other minor stuff

    the winforms treeview does not change the selected state of a node when it is checked/unchecked (this is good)

    and is the a way to show a style default/hot/etc. only around the text part of the node?



    (from your documentation)

  • Posted 15 November 2017, 5:05 am EST

    Hello,

    Thank you for sharing the screen-shots.

    1. >>The horizontal scroll width expands to a width to accommodate all nodes (even if the nodes are not visible)

      We could observe the same, hence we have forwarded it to the developer.
    2. >> when you click on a node, the controls automatically scrolls to where the leftmost character in the text displayed on the node is aligned with the left edge of the control

      This is designed behavior. C1TreeView inherits from grid, and testing this with the grid, the same behavior was observed, since every node is basically a cell and clicking on a cell selects the cell hence shows the left edge.

      3. is there a way to show a style default/hot/etc. only around the text part of the node?

      This is not possible using current C1TreeView.

    Regards,

    Ruchir Agarwal

  • Posted 15 November 2017, 9:15 am EST

    As for #2, when a column is not in auto-size mode, clicking on a node does not cause the peculiar right scrolling action (which is the way it should work). There should be some way to turn this off, if desired when columns are autosized.

    IMHO, since a treeview is enough of a different way of representing data, it shouldn’t inherit from anything, since that would require forcing a base control into doing something it wasn’t designed to do efficiently or logically. The important navigating of a treeview is done on the tree part of the control, and to have that scroll out of sight by clicking a node is less than ideal.

  • Posted 16 November 2017, 8:38 am EST

    Hello,

    Comparing this behavior with other TreeView structures and understanding your perspective for this requirement of the horizontal scrollbar to remain at its position when node is selected/clicked, we have now escalated the issue to the concerned team for fix {Tracking ID: 297676}.

    We will update you when it is fixed.

    Let us know if you are facing any other issues. We would be happy to assist you further.

    Thanks,

    Ruchir Agarwal

  • Posted 16 November 2017, 5:41 pm EST

    Great!

    In the meanwhile, is there a way to reset a specific node to display with the current style as defined by the current theme?

    Thanks,

    Kingman

  • Posted 20 November 2017, 8:41 am EST

    Hi Kingman,

    Regarding is there a way to reset a specific node to display with the current style as defined by the current theme?

    We have responded to the same over another forum post: https://www.grapecity.com/en/forums/winforms-edition/treeview-theme-problem----#hellowe-could-not-observe-

    Hence, request you to please refer to the same.

    Thanks,

    Ruchir Agarwal

  • Posted 26 December 2017, 5:21 am EST

    Hi KIngman,

    Regarding the issue “C1TreeView scrolls very slow as the number of items increases” {Tracking ID: 295397}: We are happy to inform you that the issue has been fixed in an internal build and its ETA is January’2018.

    Thanks,

    Ruchir Agarwal

  • Posted 24 January 2018, 4:54 am EST

    Hi,

    The issues

    1. C1TreeView scrolls very slow as the number of items increases
    2. C1TreeView not updating old nodes styles
    3. Selecting a node scrolls C1TreeView to the left edge of selected/clicked node.

    are fixed in the latest hotfix which can be downloaded from the below mentioned link:

    http://prerelease.componentone.com/hotfixes/dotnet/C1WinForms.4_4.0.20173.291.zip

    To see the fix for (3), kindly set the ScrollOnMouseClick property to False: ```

    Me.C1TreeView1.ScrollOnMouseClick = False

    
    Best Regards,
    Esha
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels