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

Right Click on Cluster to diaplay a context menu with the List of Cluster Childern

3 Answers 68 Views
Map
This is a migrated thread and some comments may be shown as answers.
vinutha
Top achievements
Rank 1
vinutha asked on 08 Dec 2014, 05:37 AM
On Right Click of the Cluster I would like to get the List of all the Children inside that ClusterItem , SO that I can Display the List in the Context Menu . 


Below is my cluster Code. Could anyone please help me in this




 <telerik:InformationLayer x:Name="InformationLayer" ClusteredDataSource="{StaticResource ClusteredDataSource}"></telerik:InformationLayer>


  <DataTemplate x:Key="ClusterTemplate" x:Name="DataTemplate">
            <Grid x:Name="ParentRoot"     Width="40" Height="40" telerik:MapLayer.Location="{Binding Path=Center}" telerik:MapLayer.HotSpot="0.5,1"
 MouseRightButtonUp="MapMouseRightButtonUp" Tag="{Binding Path=Data}" >
                <Path Data="" Stretch="Fill" Margin="0,0,-0.574,0" StrokeThickness="0.2">
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Green"  Offset="0"/>
                            <GradientStop Color="Green" Offset="1"/>
                            <GradientStop Color="Green"  Offset="0.523"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <!-- Title -->
                <StackPanel x:Name="Text" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <TextBlock  FontSize="13" FontWeight="Bold"
                               Foreground="White"
                               Text="{Binding Path=Count}"/>
                </StackPanel>

            </Grid>
 </DataTemplate>

        <local:MassiveDataSource x:Key="MassiveDataSource" />
        <local:Test x:Key="Test"/>

            <telerik:ClusteredDataSource x:Key="ClusteredDataSource"
                 ItemsSource="{StaticResource MassiveDataSource}" ItemTemplate="{StaticResource ClusteredItemTemplate}"
                ClusterItemTemplate="{StaticResource ClusterTemplate}"   
                GenerateClustersOnZoom="True">

        </telerik:ClusteredDataSource>

3 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 08 Dec 2014, 08:04 AM
Hi Vinutha,

Please check out the following forum thread and let us know if the project from 8 Dec 2014 meets your requirements.

Regards,
Petar Mladenov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
vinutha
Top achievements
Rank 1
answered on 08 Dec 2014, 11:34 AM
Hi Petar,

Thank you so much for your reply ,  Please find attached one sample project .


Here when I right click the cluster I want to show the Cluter.Items  in the Context Menu and  I want to perform some action with each item in the context menu . So how can I access the Children of the CluteItem from Code behind .

Thank you for your help in Advance.


Regards
Vinutha

0
vinutha
Top achievements
Rank 1
answered on 09 Dec 2014, 07:35 AM
Hi Petar ,


Thanks This did the trick for me


Regards
Vinutha
Tags
Map
Asked by
vinutha
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
vinutha
Top achievements
Rank 1
Share this question
or