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

GridViewCellBase.CellDoubleClickEvent now working after upgrade the app to telerik q2 2012 silverlight

2 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ruchi
Top achievements
Rank 1
Ruchi asked on 02 Oct 2012, 06:33 AM
Hello Team,

I am working on silverlight applicaiton. i have upgraded the telerik silverlight version to Q2 2012.

please find my code below for the cell double click event.
this.grdFormList.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);
 
private void OnCellDoubleClick(object sender, RadRoutedEventArgs args)
{
}

after upgrading the version to q2 2012. this event is not going to fire. we have done above code for header cell click to select the header cell on double click. we have disabled the sorting functionality of Grid.

can anyone help me out? help will be appriciated.

Thanks and Regards,
Ruchi Patel

2 Answers, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 03 Oct 2012, 03:10 PM
Hello Ruchi,

The DoubleClick event is not fired, because in this case you do not actually click on the cell but on a TextBlock which is in the HeaderCell element by default. Moreover, the TextBlock marks mouse events as handled, so I suggest you to attach to MouseLeftButtonDown Event using the AddHandler extension methods. Check out the following code snippet for reference:

public MainPage()
       {
           InitializeComponent();
 
            this.AddHandler(FrameworkElement.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnMouseLeftButtonDown), true);
       }
 
       private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
       {
           if (e.ClickCount == 2)
           {
           }
       }
I have tested it at my side and the event is fired.


All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ruchi
Top achievements
Rank 1
answered on 04 Oct 2012, 05:35 AM
Hello Yoan,

Thank you for the response it works.

Thanks and Regards,
Ruchi Patel
Tags
GridView
Asked by
Ruchi
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Ruchi
Top achievements
Rank 1
Share this question
or