We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DoubleClick Event on Row possible

Thread ID:

Created:

Updated:

Platform:

Replies:

116492 Jun 2,2014 12:20 PM UTC Jun 14,2014 08:38 AM UTC Silverlight 5
loading
Tags: GridDataControl
Jochen Renner
Asked On June 2, 2014 12:20 PM UTC

Hi,

is it possible to create a DoubleClick Event on the Row of a GridDataControl?

Best

Akila Rajaram [Syncfusion]
Replied On June 3, 2014 01:40 PM UTC

Hi Jochen,

 

We have analyzed your query and you can achieve your requirement by using CellClick event,  in that event arguments you can get the ClickCount, based on ClickCount property you can do your action as shown in the below code snippet,

 

public MainWindow()

         {

          InitializeComponent();

            dataGrid.CellClick += dataGrid_CellClick;

           }

 

void dataGrid_CellClick(object sender, GridCellClickEventArgs e)

        {

            if (e.ClickCount==2)

            {

               //code for cell Double click action

            }

}

 

 

Please let us know if you have any queries.

 

Regards,

Akila


Jochen Renner
Replied On June 3, 2014 03:55 PM UTC

Hi Akila,

  1. On the GridDataControl class I have no CellClick Event directly.
    If I goto the model.grid of GridDataControl there is a event called "CellClick"
    dataGrid.Model.Grid.CellClick += Grid_CellClick;
    As I use this it will lead me to the following problem..

  2. I only get these Properties on GridCellEventArgs:

    So there is no Property "ClickCount".

Do I miss something here?


Best


Akila Rajaram [Syncfusion]
Replied On June 4, 2014 10:18 AM UTC

Hi Jochen,

 

Sorry for the inconvenience . We have provide the previous sample in WPF platform and there is no support for ClickCount property in CellGrid event .You can achieve the double click event by using MouseLeftButtonUp event as shown in the below code snippet,

 

public MainPage()

        {

            InitializeComponent();

            columnStylegrid.MouseLeftButtonUp += columnStylegrid_MouseLeftButtonUp;

        }

        DateTime? previousclick;

        void columnStylegrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

        {

            if (previousclick != null && DateTime.Now.Subtract((DateTime)previousclick).TotalMilliseconds < 100)

            {

                previousclick = null;

                MessageBox.Show("Double click!");

 

            }

            else

                previousclick = DateTime.Now;

        }

 

 

 

Please let us know if you have any queries.

 

Regards,

Akila


Jochen Renner
Replied On June 4, 2014 03:20 PM UTC

Hi,

with this workaround it would be difficult to choose between single and double click as a double click would always fire the single click too.

Best

Akila Rajaram [Syncfusion]
Replied On June 6, 2014 01:34 PM UTC

Hi Jochen,

 

In the already provided solution, if condition will be true only when you double click the Cell. In the remaining cases, else part will be executed.

 

public MainPage()

        {

            InitializeComponent();

            columnStylegrid.MouseLeftButtonUp += columnStylegrid_MouseLeftButtonUp;

        }

        DateTime? previousclick;

        void columnStylegrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

        {

            if (previousclick != null && DateTime.Now.Subtract((DateTime)previousclick).TotalMilliseconds < 100)

            {

                previousclick = null;

                MessageBox.Show("Double click!");

 

            }

            else

                previousclick = DateTime.Now;

        }

 

 

We have achieved the same using helper to fire event only in case of double click. Please find the sample from the below specified location.

 

                                                                                                                                                                                

Please let us know if you have any queries,

 

Regards,

Akila                 

Attachment: DoubleClickDemo_a88aa7ad.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;