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

Exception when clicking button in new ComboBox cell

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

6 Replies

AN Anonymous October 5, 2007 11:31 AM UTC

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


HA haneefm Syncfusion Team October 6, 2007 12:07 AM UTC

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


AN Anonymous October 8, 2007 01:42 PM UTC

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.


AN Anonymous October 9, 2007 10:40 AM UTC

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


AN Anonymous October 11, 2007 10:05 AM UTC

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


SA Saravanan A Syncfusion Team October 24, 2007 08:54 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon