This is a migrated thread and some comments may be shown as answers.

RadTreeMap CustomMapping last item never has children

1 Answer 35 Views
TreeMap and PivotMap
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 19 Jul 2011, 09:20 PM
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}
    Else
        ' 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?

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 20 Jul 2011, 03:31 PM
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,
Ves
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!

Tags
TreeMap and PivotMap
Asked by
Peter
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or