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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Divide by zero messagebox when double clicking combobox

Thread ID:





46186 Jul 7,2006 10:30 AM UTC Jul 7,2006 05:35 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On July 7, 2006 10:30 AM UTC

Hi, I get messagebox stating "divide by zero error" whenever I doubleclick a combobox whose datasource has no items. so for ex: datasource = new SomeObject[]{} will show the error when doubleclicking. datasource = new SomeObject[]{o1,o2,...}will not. Is there a way to get rid of this message?

Administrator [Syncfusion]
Replied On July 7, 2006 03:32 PM UTC

Hi Palmer, When double clicked on a combobox cell, the OnEditPartMouseDown method of the combobox cell renderer is called that replaces it with the next item in the dropdown. To cancel it, for now you have to override the OnEditPartMouseDown deriving the cell renderer and cellmodel. Here is a sample that does it. Let me know if this helps. Thanks, Haneef

Administrator [Syncfusion]
Replied On July 7, 2006 05:35 PM UTC

Hi Palmer, Later Essential Version, a new property has been added to the GridComboBoxCellModel for this. You can set this property using the following code. //Access the cellModel GridComboBoxCellModel cm = this.gridControl1.CellModels["ComboBox"] as GridComboBoxCellModel; //Lets you enable or turn off selecting the next index when user double clicks inside cell. cm.AllowDoubleClickChangeSelectedIndex = false; Let me know if this helps. Best regards, Haneef


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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