Context Menu wi

2 posts, 0 answers
  1. Naren
    Naren avatar
    53 posts
    Member since:
    Aug 2010

    Posted 27 Sep 2010 Link to this post

    I am using ContextMenu.on ListBox.

    My Xaml is as follows:

     <Grid x:Name="LayoutRoot" Background="White">
            <ListBox x:Name="whatfirstAttributeList" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled" dragDrop:RadDragAndDropManager.AllowDrag="True" FontWeight="Normal" >
                        <StackPanel Width="300" Background="{Binding Name, Converter={StaticResource myconverter}}">
                            <TextBlock Text="{Binding Name}" x:Name="AttributeList" FontSize="12"/>
                    <telerikNav:RadContextMenu x:Name="ContextMenu" ItemClick="ContextMenu_ItemClick" Opened="ContextMenu_Opened">
                        <telerikNav:RadMenuItem Header="Add Attribute" />
                        <telerikNav:RadMenuItem Header="Delete Attribute"/>

    How can I get selected Item on ListBox in following cases?
    private void ContextMenu_Opened(object sender, RoutedEventArgs e)
                if (this.whatfirstAttributeList.SelectedItem != null)
    this always returns Null.........
    private void ContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
                DataItem dataItem = this.selectedColumnItem.DataContext as DataItem;
    This doesn't work....always give error....

    Can you help me out....
    Thanx in advance ...waiting for reply...
  2. George
    George avatar
    1332 posts

    Posted 29 Sep 2010 Link to this post

    Hi Naren,

    I will answer you in this thread as well.

    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