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.
Unfortunately, activation email could not send to your email. Please try again.

Activate cell in grid on right click

Thread ID:

Created:

Updated:

Platform:

Replies:

38684 Dec 16,2005 01:47 AM Dec 16,2005 06:13 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 16, 2005 01:47 AM

I am using syncfusion(2.0.5.1) GridControl in my application. Currently I activate the cell by clicking on the cell. The gridcontrol is associated with the context menu. By right clicking on the cell the context menu will be visible. I need to just right click on a cell and it should activate the particular cell and display the context menu. Is there any properties avialable in gridcontrol to specify this. Kindly let me know. Thanks Rohith

stanleyj [Syncfusion]
Replied On December 16, 2005 05:31 AM

Hi Rohith, See if this helps. private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; this.gridControl1.MouseDown += new MouseEventHandler(gridControl1_MouseDown); } int row, col; private void gridControl1_MouseDown(object sender, MouseEventArgs e) { if(e.Button == MouseButtons.Right) { GridCurrentCell cc = this.gridControl1.CurrentCell; Point pt = new Point(e.X, e.Y); this.gridControl1.PointToRowCol(pt, out row, out col); this.gridControl1.CurrentCell.MoveTo(row, col); this.contextMenu1.Show(this.gridControl1, pt); } } Best Regards, Stanley

Administrator [Syncfusion]
Replied On December 16, 2005 05:50 AM

Hi stanley, Is this the only way to make the cell active on right click. I do not want to do this by handling the mouse click event. Kindly let me know if there are any properties available in gridcontrol which will set this. Thanks Rohith

stanleyj [Syncfusion]
Replied On December 16, 2005 06:13 AM

Hi Rohith, Try setting this property, see if this helps. this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left | MouseButtons.Right; Best regards, Stanley

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.

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.

;