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. Image for the cookie policy date
close icon

GridControl ComboBox

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

5 Replies

BM Bharath M Syncfusion Team June 22, 2010 04:45 AM UTC

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


NF Nathaniel Felt June 22, 2010 08:34 PM UTC

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.


CI Christopher Issac Sunder K Syncfusion Team June 23, 2010 09:34 AM UTC

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.


NF Nathaniel Felt June 23, 2010 09:01 PM UTC

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


NR Nirmal Raja Syncfusion Team June 24, 2010 03:44 AM UTC

Hi Nathaniel,

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

Regards,
Nirmal

Loader.
Live Chat Icon For mobile
Up arrow icon