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

3 posts, 1 answers
  1. Ruchi
    Ruchi avatar
    54 posts
    Member since:
    Apr 2012

    Posted 02 Oct 2012 Link to this post

    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. Answer
    Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 03 Oct 2012 Link to this post

    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.

  3. DevCraft banner
  4. Ruchi
    Ruchi avatar
    54 posts
    Member since:
    Apr 2012

    Posted 04 Oct 2012 Link to this post

    Hello Yoan,

    Thank you for the response it works.

    Thanks and Regards,
    Ruchi Patel
Back to Top