RadTreeMap CustomMapping last item never has children

2 posts, 0 answers
  1. Peter
    Peter avatar
    9 posts
    Member since:
    Apr 2011

    Posted 19 Jul 2011 Link to this post

    When using RadTreeMap and defining a CustomMapping for the TypeDefinition, the last item in the collection never has any children...

    Protected Overrides Sub Apply(treemapItem As RadTreeMapItem, dataItem As Object)
        Dim ie = DirectCast(dataItem, MainPage.ImageEntry)
        Dim grid = treemapItem.ChildrenOfType(Of Grid).SingleOrDefault
        If Not grid Is Nothing Then
            grid.Background = New ImageBrush With {.ImageSource = ie.Icon, .Stretch = Stretch.Uniform, .AlignmentX = AlignmentX.Center, .AlignmentY = AlignmentY.Center}
            ' last item ends up here
        End If
    End Sub

    ...all the other items work OK, and if you add an additional item to the end, it becomes the one without Children.  Is this part of being "beta", or is this intended behavior?
  2. Ves
    Ves avatar
    2870 posts

    Posted 20 Jul 2011 Link to this post

    Hi Peter,

    Indeed, this effect is observed. Our developers are aware of it and a fix will be available in the next weekly internal build, expected to become available on Monday. For the time being you can either use the BrushColorizer as described in the other forum thread you have started or wire the SizeChanged event for that last item and apply the changes in its event handler. The second approach is shown in the Custom Mapping example. Another temporary solution would be to call the ApplyTemplate method for that last item manually and then find the grid in it.

    Best regards,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top