hostedcontrol problem

5 posts, 1 answers
  1. jtby
    jtby avatar
    43 posts
    Member since:
    Feb 2007

    Posted 23 Mar 2010 Link to this post

    Hi - I am having a strange problem when using hostedcontrols with radtreeview.  Replicate by dragging a new radtreeview onto a vb.net form.  Set AllowArbitraryItemHeight to true, and then add code to add some nodes with some hostedcontrols containing radpanels.  When I run the app, a radpanel appears incorrectly at the very upper left of the treeview.  Then I scroll to the bottom, and back up to the top, and the mystery panel disappears.  Also, when I expand / collapse nodes, it all seems to go a bit haywire.  Using 2010.1.10.308 and VS2008 / VB.NET. Any ideas?  Thanks!

    Here is code to replicate the problem:

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim viewParentNode(3) As Telerik.WinControls.UI.RadTreeNode
    viewParentNode(1) = New Telerik.WinControls.UI.RadTreeNode("Level1")
    viewParentNode(2) = New Telerik.WinControls.UI.RadTreeNode("Level2")
    viewParentNode(3) = New Telerik.WinControls.UI.RadTreeNode("Level3")

    Dim viewChildNode(5) As Telerik.WinControls.UI.RadTreeNode
    viewChildNode(1) = New Telerik.WinControls.UI.RadTreeNode("sub 1")
    viewChildNode(2) = New Telerik.WinControls.UI.RadTreeNode("sub 2")
    viewChildNode(3) = New Telerik.WinControls.UI.RadTreeNode("sub 3")
    viewChildNode(4) = New Telerik.WinControls.UI.RadTreeNode("sub 4")
    viewChildNode(5) = New Telerik.WinControls.UI.RadTreeNode("sub 5")

    Dim thumbnailPanel(5) As Telerik.WinControls.UI.RadPanel
    Dim viewImageNode(5) As Telerik.WinControls.UI.RadTreeNode
    For i = 1 To 5
    thumbnailPanel(i) = New Telerik.WinControls.UI.RadPanel
    thumbnailPanel(i).Height = 61
    thumbnailPanel(i).Width = 100
    viewImageNode(i) = New Telerik.WinControls.UI.RadTreeNode
    viewImageNode(i).HostedControl = thumbnailPanel(i)
    viewImageNode(i).ItemHeight = "75"
    viewImageNode(i).Expanded = True
    viewChildNode(i).Nodes.Add(viewImageNode(i))
    Next

    viewParentNode(1).Nodes.Add(viewChildNode(1))
    viewParentNode(1).Nodes.Add(viewChildNode(2))
    viewParentNode(2).Nodes.Add(viewChildNode(3))
    viewParentNode(2).Nodes.Add(viewChildNode(4))
    viewParentNode(3).Nodes.Add(viewChildNode(5))

    For i = 1 To 3
    RadTreeView1.Nodes.Add(viewParentNode(i))
    Next

    RadTreeView1.ExpandAll()
    RadTreeView1.Refresh()

    End Sub




  2. jtby
    jtby avatar
    43 posts
    Member since:
    Feb 2007

    Posted 23 Mar 2010 Link to this post

    ok, some progress:  adding:

    RadTreeView1.AllowArbitraryItemHeight = True

    ... after I populate the radtreeview takes care of the problem panel showing in the upper left. However, I still have lots of problems when I expand and contract nodes.

    For example, I run the code sample I provides with the line here added at the end and it looks great.  Then I collaps sub1, and the hostedcontrols in some of other expanded nodes also disappear.  If I then expand sub1 they reappear but not exactly in the right position.  Then I slide the the radtreeview scrollbar up and down, and everything redraws properly.  Maybe I need to call something to invalidate / redraw the treeview after a node is expanded or collapsed?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Mar 2010 Link to this post

    Hello jtby,

    Thank you for writing.

    I strongly encourage you to not use the hosted control feature of RadTreeView as it is only feasible for root nodes without child nodes and when there are no scroll bars. Currently RadTreeView uses our old layout system which completely disregards the hosted control property and only uses a very small set of node layout properties. This property will be hidden in the Q2 2010 release and will probably be made obsolete soon after. I am afraid that there is nothing we can suggest at this time to work around this problem, except to figure out another way of displaying your data. I am sorry for this turnaround. This problem will be addressed in the next major version of RadTreeView.

    Best wishes,
    Victor
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. jtby
    jtby avatar
    43 posts
    Member since:
    Feb 2007

    Posted 26 Mar 2010 Link to this post

    ok thanks.  Then a feature request for radtreeview is:

    ... for a node, be able to have text, and an image, but instead of text next to the image have the text above or below the image.  My scenario is a thumbnail view picker.


  6. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 31 Mar 2010 Link to this post

    Hello jtby,

    Thank you for the feature request.

    We will consider providing a multi-column view for RadTreeView for a future release and a more flexible text/image relation for the nodes.

    Write again if you have additional questions.

    Best wishes,
    Victor
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WinForms is Visual Studio 2017 Ready