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

Where is the click and double events?

2 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 01 Mar 2010, 05:06 PM
Where do I find the double click.. ?

I want to click on the row.. get the SelectedItem and close the window.

thanks again

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 02 Mar 2010, 07:52 AM
Hi Jon The Nerd,

You could try something like that:

public Window1()
{
    InitializeComponent();
  
    this.playersGrid.ItemsSource = Club.GetPlayers();
  
    this.AddHandler(Control.MouseDoubleClickEvent, new MouseButtonEventHandler(playersGrid_MouseDoubleClick), true);
}
  
void playersGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
    var senderElement = (FrameworkElement)e.OriginalSource;
    var clickedRow = senderElement.ParentOfType<GridViewRow>();
  
    if (clickedRow != null)
    {
        // row double-clicked
    }
}


Sincerely yours,
Milan
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
Jon
Top achievements
Rank 1
answered on 02 Mar 2010, 01:05 PM
thanks!
Tags
GridView
Asked by
Jon
Top achievements
Rank 1
Answers by
Milan
Telerik team
Jon
Top achievements
Rank 1
Share this question
or