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

Right-Clicking while editing NumericUpDown control within a grid

Thread ID:

Created:

Updated:

Platform:

Replies:

73129 Apr 21,2008 04:02 PM UTC Apr 22,2008 09:40 PM UTC WinForms 2
loading
Tags: GridControl
Alex Maldonado
Asked On April 21, 2008 04:02 PM UTC

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 22, 2008 02:23 AM UTC

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 09:40 PM UTC

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.

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

;