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

4 posts, 1 answers
  1. vinutha
    vinutha avatar
    11 posts
    Member since:
    Dec 2014

    Posted 07 Dec 2014 Link to this post

    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>
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 08 Dec 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. vinutha
    vinutha avatar
    11 posts
    Member since:
    Dec 2014

    Posted 08 Dec 2014 in reply to Petar Mladenov Link to this post

    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

  5. vinutha
    vinutha avatar
    11 posts
    Member since:
    Dec 2014

    Posted 09 Dec 2014 in reply to vinutha Link to this post

    Hi Petar ,


    Thanks This did the trick for me


    Regards
    Vinutha
Back to Top