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.
Syncfusion Feedback

Divide by zero messagebox when double clicking combobox

Thread ID:

Created:

Updated:

Platform:

Replies:

46186 Jul 7,2006 10:30 AM UTC Jul 7,2006 05:35 PM UTC Windows Forms 2
loading
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 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

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

;