I created a context menu for each row in a gridview following this example - http://blogs.telerik.com/vladimirenchev/posts/09-04-09/how_to_radgridview_for_silverlight_row_context_menu_in_three_simple_steps.aspx and it works fine without the SelectionChanged event.
Now, the problem is that I want a user to be able to left-click a row and it will take them to another page:
But this code fires when I try to right-click a row to get to the context menu. So the SelectionChanged event fires for both left and right clicks.
How can I figure out which mouse button was clicked in the SlectionChanged event so if a right button is clicked, then show context menu, if a left button is clicked, then navigate to other page?
Now, the problem is that I want a user to be able to left-click a row and it will take them to another page:
private void radGVInspectionForm_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
{ |
////Get the reference to the selected item |
object mySelectedRow = radGVInspectionForm.SelectedItem; |
////Get the id of the form |
string id = ((InspectionFormDS.InspectionFormTableRow)mySelectedRow).Id; |
////Navigate to the edit form page |
this.NavigationService.Navigate(new DisplayInspectionFormPage(Convert.ToInt32(id))); |
} |
How can I figure out which mouse button was clicked in the SlectionChanged event so if a right button is clicked, then show context menu, if a left button is clicked, then navigate to other page?