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

SelectionChanged and MouseLeftButtonUp event

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ori Tidhar
Top achievements
Rank 1
Ori Tidhar asked on 01 Oct 2009, 08:04 AM
Hello,

Version: 2009.2.911.35 .

I defined three events:

RadGridView1_SelectionChanged
RadGridView1_MouseLeftButtonUp
RadGridView1_MouseUp

Because the "SelectionChanged" event, left click does not fire the other two events (only right click).

Is this by design ?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 02 Oct 2009, 12:44 PM
Hi Ori Tidhar,

I have tried to reproduce the problem but without any success. Still, there is one workaround that you can try:

public Window1()  
{  
    InitializeComponent();  
 
    this.playersGrid.ItemsSource = this.data;  
    this.playersGrid.SelectionChanged += new System.EventHandler<SelectionChangeEventArgs>(playersGrid_SelectionChanged);  
 
    this.AddHandler(FrameworkElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.playersGrid_MouseLeftButtonUp), true);  
    this.AddHandler(FrameworkElement.MouseUpEvent, new MouseButtonEventHandler(this.playersGrid_MouseUp), true);  
}  
 
void playersGrid_SelectionChanged(object sender, SelectionChangeEventArgs e)  
{  
      
}  
 
void playersGrid_MouseUp(object sender, MouseButtonEventArgs e)  
{  
      
}  
 
void playersGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)  
{  
      

Using this kind of AddHandler you can event subscribe to handled events. Now you should be able to use those event.

Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Ori Tidhar
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or