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

[Solved] MouseButtonEventArgs

5 Answers 180 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.
guy
Top achievements
Rank 1
guy asked on 13 Oct 2010, 04:27 PM
hi
im having a problem receiveing current row data using MouseButtonEventArgs
(my need is to open radwindow and i need guid )
this is how i load the event

this.AddHandler(GridViewRow.MouseLeftButtonUpEvent, new  MouseButtonEventHandler(this.GridViewRow_OnMouseLeftButtonUp), true);



i want to do somthing like this
InputContext = e.Options.Source.DataContext
id = (InputContext)... get id ..;
displayRadWindow("http://some url " + id+ "}");



5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Oct 2010, 02:50 PM
Hello guy,

You may handle the MouseLeftButtonDown event as follows:

this.playersGrid.AddHandler(GridViewRow.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnMouseLeftButtonDown), true);
         
 
private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    var clickedElement = e.OriginalSource as FrameworkElement;
    var parentRow = clickedElement.ParentOfType<GridViewRow>();
     
    if (parentRow != null)
    {
        //get row's details.
    }
}
 

Sincerely yours,
Maya
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
guy
Top achievements
Rank 1
answered on 18 Oct 2010, 03:49 PM
is there a way to receive this data with double click ?
i have a another event that work this way (drug and drop) 
0
Maya
Telerik team
answered on 18 Oct 2010, 03:55 PM
Hi guy,

You may take a look at our demos demonstrating how to handle the DoubleClick event. In case this does not meet your requirements, I would need more details about your specifications.

Greetings,
Maya
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
guy
Top achievements
Rank 1
answered on 18 Oct 2010, 05:05 PM
the example in the demo is from xaml
i need to open a record on double click(event from main.xaml.cs)
do you have example of it?
0
Maya
Telerik team
answered on 20 Oct 2010, 03:59 PM
Hello guy,

On examining the demo for ClickEvents in RadGridView, you may see that the DoubleClick functionality is achieved by adding a handler to GridViewCellBase. So, I am a little bit confused about your exact requirements. What is the exact behavior that you expect ? Any relevant information would be helpful. 

 

Greetings,
Maya
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
guy
Top achievements
Rank 1
Answers by
Maya
Telerik team
guy
Top achievements
Rank 1
Share this question
or