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.

Right-Clicking while editing NumericUpDown control within a grid

Thread ID:

Created:

Updated:

Platform:

Replies:

73129 Apr 21,2008 12:02 PM Apr 22,2008 05:40 PM Windows Forms 2
loading
Tags: GridControl
Alex Maldonado
Asked On April 21, 2008 12:02 PM

Hi,

Whats the proper way to handling Right-Clicks on a NumericUpDown control that is in edit mode within a GridDataBoundGrid?

I got a semi working version by attaching to the current cell renderer's Control on mouse click event but it doesn't work for me everytime.

e.g
GridCurrentCell cc = _configGrid.CurrentCell;

if(_gridConfigMouseHandler == null)
{
_gridConfigMouseHandler = new MouseEventHandler(ConfigGridControlMouseHandlerHelper);
cc.Renderer.Control.MouseDown+=_gridConfigMouseHandler;
}




-- Alex


Sri Rajan [Syncfusion]
Replied On April 21, 2008 10:23 PM

Hi Alex,

Thank you for your interest in Syncfusion products.

Here is the sample code which displays a message when right clicking on the NumericUpDown cell while editing.


void gridDataBoundGrid1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "NumericUpDown")
{
cc.Renderer.Control.MouseDown += new MouseEventHandler(Control_MouseDown);
}
}

void Control_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
Console.WriteLine("NumericUpDown in Editing Mode");
}
}


Please let me know if this helps.

Best Regards,
Srirajan


Alex Maldonado
Replied On April 22, 2008 05:40 PM

Thanks, it works munch better.

-- Alex


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.

;