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

Select Cell on Right Mouse CLick

Thread ID:

Created:

Updated:

Platform:

Replies:

95447 Jul 8,2010 01:37 PM UTC Jul 23,2010 06:51 AM UTC Silverlight 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 8, 2010 01:37 PM UTC

I am making a right click context menu available in my grid. The menu may be different depending on which cell was "right clicked" on. I can detect the Current Cell, but the Right CLick action does not make a cell the current cell.

I know how to use the MouseRightButtonDown and MouseRightButtonUp events, but I don't know how to detect which cell the user was over when they performed the right click action.

Is it possible to activte the cell using the right click event?

Thanks for your help.


Muthulakshmi N [Syncfusion]
Replied On July 15, 2010 01:04 PM UTC

Hi William,

Handling MouseRightButtonDown event you can activate the current cell during right click action of the mouse. The c# code is given below.

Code behind:

void gridControl1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
var cell = this.gridControl1.PointToCellRowColumnIndex(e);
this.gridControl1.CurrentCell.Activate(cell.RowIndex,cell.ColumnIndex);
this.gridControl1.CurrentCell.MoveTo(cell);
e.Handled = true;
}

Let us know if you need any details.

Regards,
Muthulakshmi

Administrator [Syncfusion]
Replied On July 16, 2010 01:40 PM UTC

Thank you, this worked perfectly.

Muthulakshmi N [Syncfusion]
Replied On July 23, 2010 06:51 AM UTC

Hi William,

Thanks for the details. Let us know if you face any other issues.

Regards,
Muthulakhmi

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

;