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.

GridControl ComboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

95108 Jun 21,2010 05:57 PM Jun 23,2010 11:44 PM ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
Nathaniel Felt
Asked On June 21, 2010 05:57 PM

When right-clicking on a combobox in a GridControl is it possible to prevent the combobox drop down? I only want the combobox drop down list to appear when a user left clicks.

Thank you

Bharath M [Syncfusion]
Replied On June 22, 2010 12:45 AM

Hi Nathaniel,

Thank you for your interest in Syncfusion products.

Before I proceed to give you a solution, I would like to know more about your requirement. Could you please update us the grid product that are using like ASP.Net(Webform/MVC), WPF, Silverlight etc.?

The information provided would be of great help in resolving the issue

Regards,
Bharath

Nathaniel Felt
Replied On June 22, 2010 04:34 PM

Thank you for your response.

I just realized I posted this in the incorrect form. It should be in the Windows Forms section.

I am using the WinForms GridControl.

Christopher Issac Sunder K [Syncfusion]
Replied On June 23, 2010 05:34 AM

Hi Nathaniel,

Thank you for your interest in Syncfusion products.

To prevent the combo box drop down while right clicking on the cell, you can handle the MouseDown event and CurrentCellShowingDropDown event with the following code.


this.gridControl1.CurrentCellShowingDropDown += new Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventHandler(gridControl1_CurrentCellShowingDropDown);

this.gridControl1.MouseDown += new MouseEventHandler(gridControl1_MouseDown);
void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
{
if (RightButton)
{
e.Cancel = true;
}
}
bool RightButton;
void gridControl1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
RightButton = true;
}
else
{
RightButton = false;
}
}


Please refer the following sample link which illustrates the above.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GC_ComboRightclick-518024068.zip

Please let me know you have any other concerns.

Regards,
Christopher K.

Nathaniel Felt
Replied On June 23, 2010 05:01 PM

I knew this would be an easy fix. Thank you for the help.

Nirmal Raja [Syncfusion]
Replied On June 23, 2010 11:44 PM

Hi Nathaniel,

Thank you for the update. We are glad to hear that the provided solution resolves the issue on your side.

Regards,
Nirmal

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.

;