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

[Solved] LeftClick Context Menu not Firing

3 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ben
Top achievements
Rank 1
Ben asked on 01 Sep 2010, 07:44 PM
I'm having an issue with upgrading my existing application to use the latest release of the GridView.  The following sample shows my issue.  Essentially, I'm trying to show a ContextMenu using the Ctrl+Left Click Modifier.  I cannot get the context menu to show on the rows or headers, it seems like there is another control handling the event.

<UserControl x:Class="Telerik_Q2_2010_Samples.MainPage"
    xmlns:c="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
      
    <Grid x:Name="LayoutRoot" Margin="30">
  
        <grid:RadGridView ItemsSource="{Binding}" AutoGenerateColumns="False">
            <c:RadContextMenu.ContextMenu>
                <c:RadContextMenu ModifierKey="Control" EventName="MouseLeftButtonDown">
                    <c:RadMenuItem Header="Test" />
                </c:RadContextMenu>
            </c:RadContextMenu.ContextMenu>
            <grid:RadGridView.Columns>
                <grid:GridViewDataColumn Header="FirstName" Width="*" IsReadOnly="True" DataMemberBinding="{Binding FirstName}" />
                <grid:GridViewDataColumn Header="LastName" Width="*" IsReadOnly="True" DataMemberBinding="{Binding LastName}" />
            </grid:RadGridView.Columns>
        </grid:RadGridView>
    </Grid>
</UserControl>

And here is my code-behind.
using System.Collections.Generic;
using System.Windows.Controls;
  
namespace Telerik_Q2_2010_Samples
{
    public partial class MainPage : UserControl
    {
        public List<Customer> Customers { get; set; }
  
        public MainPage()
        {
            InitializeComponent();
  
            Customers = new List<Customer>()
                            {
                                new Customer { FirstName = "John", LastName="Doe" }
                            };
            DataContext = Customers;
        }
    }
  
    public class Customer
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Sep 2010, 09:14 AM
Hi,

 Generally grid elements responsible for something on MouseLeftButtonDown will handle the event internally. Data rows for selection, headers cells for sorting, etc. Can you explain a bit more about your scenario and why you need to menu on left click?

Kind regards,
Vlad
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
0
Ben
Top achievements
Rank 1
answered on 02 Sep 2010, 01:54 PM
Vlad,

We are running SL3 and don't have the right mouse button support.  This is what we used in the older version.  Do you have any key modifier recommendations that don't include the right moust button?

Thanks,
0
Vlad
Telerik team
answered on 02 Sep 2010, 02:11 PM
Hi,

 Our context menu will work on Silverlight 3 as well if you set windowless=true for your plug-in. You can check this demonstrated on our Silverlight 3 demo.

Best wishes,
Vlad
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
Tags
GridView
Asked by
Ben
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ben
Top achievements
Rank 1
Share this question
or