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

Divide by zero messagebox when double clicking combobox

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?

2 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team July 7, 2006 05:35 PM UTC

Hi Palmer, Later Essential Version 3.2.1.0, 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

Loader.
Live Chat Icon For mobile
Up arrow icon