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.

Exception when clicking button in new ComboBox cell

Thread ID:

Created:

Updated:

Platform:

Replies:

68926 Oct 5,2007 07:27 AM Oct 24,2007 04:54 AM Windows Forms 6
loading
Tags: GridControl
Anonymous
Asked On October 5, 2007 07:27 AM

Hi

We're having a problem using comboboxes in a virtual grid. What happens is as follows:

1) The user has a current cell in the grid, and invokes one of our commands from a menu item.
2) Our command sets some state in our model, and in the next OnQueryCellInfo event we set the CellType, DropDownStyle and ChoiceList. The cell immediately shows the dropdown arrow.
3) The user clicks the cell, and an InvalidOperationException is raised (traceback at end of message).

Once the user has clicked away from the cell once, we don't see the error any more. We've tried calling CurrentCell.Refresh, CurrentCell.EndEdit, and CurrentCell.MoveTo, none of which reliably make it work.

What should we do to ensure that the cell renderer has created the actual 'dropDownImp' by the time the user clicks on the cell?

Cheers
william

-------------------------------------
System.InvalidOperationException: dropDownImp is null
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.OnShowDropDown()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ShowDropDown()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ToggleDropDown()
at Syncfusion.Windows.Forms.Grid.GridDropDownCellImp.OnButtonClicked(Int32 rowIndex, Int32 colIndex, Int32 button)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.OnButtonClicked(Int32 rowIndex, Int32 colIndex, Int32 button)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.ButtonClicked(Object sender, GridCellEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridCellButton.OnClicked(GridCellEventArgs e)
catched at Syncfusion.Windows.Forms.Grid.GridCellButton.OnClicked(GridCellEventArgs e) in :line 0

Anonymous
Replied On October 5, 2007 07:31 AM

I should have mentioned: we are creating the new ComboBox in the current cell on the grid. I don't think we have any problems with any ComboBoxes which are *not* freshly created in the current cell.

william

haneefm [Syncfusion]
Replied On October 5, 2007 08:07 PM

Hi William,

We tried to reproduce this issue with Essential version 5.1, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample works fine here. Please refer to the attached sample for more details.

Forum_68926.zip

Is it possible for you to modify the attached sample or upload us a minimal sample to reproduce the issue here? This will help us to analyse the issue here and get back to you with the solution.

We appreciate your patience, and thanks for considering Syncfusion products.

Best Regards,
Haneef

Anonymous
Replied On October 8, 2007 09:42 AM

Thank you for getting back to me. The sample you uploaded does not seem to be reproducing quite what I specified; let me try again.

The issue occurs only when the grid's current cell becomes a combo box (it was originally a normal text-only cell). In the sample you uploaded, the combo box cells are always combo box cells, and so the problem does not seem to manifest.

If this is unclear, I will attempt to modify the sample to demonstrate the problem; please let me know.

Anonymous
Replied On October 9, 2007 06:40 AM

I have modified the sample as follows:

1) Dropdowns are initially inactive; send an F12 to the grid to activate them.
2) When dropdowns are activated, only the current cell will appear as a dropdown.
3) Once dropdowns are active, play around with them a bit -- selecting cells with mouse/keyboard, and then clicking on them to bring up the dropdown. Sooner or later (but probably sooner) tracebacks will start appearing at the console.

This problem appears to happen using both 5.1 and the latest 5.2 release. Please let me know what I can do to work around it.

Cheers
William

DropDownExceptions.zip

Anonymous
Replied On October 11, 2007 06:05 AM

Hi

Please confirm that you can reproduce the problem, and please let me know when I can expect a workaround or a fix.

Thanks in advance
William

Saravanan A [Syncfusion]
Replied On October 24, 2007 04:54 AM

Hi William,

Thanks for creating an incident to discuss about this issue. Here is the conclusion that we provided to this issue in that incident.

When ever a cell is getting activated, it creates an instance of the renderer of the corresponding type. In the editing mode the renderer takes the control and manage the showing/hiding of dropdown, apply the selected text to the cells, etc. So in the middle of the editing mode it is not possible to change the renderer that manages the editing mode. Hence this is not a bug.
The only way is to deactivate the CurrentCell and then activate it again with a new cell renderer. So in virtual grid, to do this process we have to navigate to another cell and came to this again.

Thanks for your interest in our syncfusion products.

Regards,
Saravanan

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.

;