Some inconsistencies with Message Boxes in FpSpread Combo events

Posted by: j2associates on 8 September 2017, 12:47 pm EST

  • Posted 8 September 2017, 12:47 pm EST

    Hello,


    This is a continutation of this thread - Wierd issues with FpSpread Combo events and message boxes: http://www.clubfarpoint.com/Forums/forums/2/51450/ShowThread.aspx. The form in the attached project has ButtonDrawMode set to CurrentCell. What follows is a list of problems and inconsistencies I see between the MultiColumnComboBoxCellType and the ComboBoxCellType. These are not show stoppers by any means, more just the little niggling things you run into from time to time.


    From the prior thread, one of the work-arounds is to make FpSpread1 the owner of the MessageBox (eg MessageBox.Show(Me.FpSpread1, "My Message"). In other cases, popping the MessageBox twice will also work. The error message is also included in the zip file.

    A. ComboDropDown event

    No Message Box

    MultiColumnComboBoxCellType
    Clicking in a new cell
    Drops if you click in the cell
    Drops if you click to the right where the drop down arrow would be
    Clicking in same cell
    Drops if you click in the cell
    Drops if you click the drop down arrow

    ComboBoxCellType
    Clicking in a new cell
    Flashes but does not drop if you click in the cell
    Drops if you click to the right where the drop down arrow would be
    Clicking in same cell
    Drops if you click in the cell
    Drops if you click the drop down arrow

    Message Box

    MultiColumnComboBoxCellType
    Clicking in a new cell
    Drops if you click in the cell after Message Box is displayed
    Never drops if you click to the right where the drop down arrow would be after Message Box is displayed
    Clicking in same cell
    Drops if you click in the cell
    Drops if you click in the cell after clicking Continue on Error Message after Message Box is displayed
    Never drops if you click the drop down arrow after Message Box is displayed

    B. ComboSelChange event

    No Message Box

    MultiColumnComboBoxCellType
    Selected value does not appear to be in edit mode (eg it is not selected) if selection is changed
    Selected value does appear to be in edit mode (eg it is selected) if selection is not changed

    ComboBoxCellType
    Selected value does appear to be in edit mode (eg it is selected) if selection is changed
    Selected value does appear to be in edit mode (eg it is selected) if selection is not changed

    Message Box - Standard

    MultiColumnComboBoxCellType
    Message box does not appear and pc beeps
    Selected value is not displayed until another cell is selected

    ComboBoxCellType
    Message box flashes and pc beeps
    Selected value is displayed in edit mode

    Message Box - FpSpread owned

    MultiColumnComboBoxCellType
    Message Box is displayed but selected value is not displayed until another cell is selected

    ComboBoxCellType
    Selected value is displayed and Message Box is displayed

    C. ComboCloseUp event

    Message Box

    MultiColumnComboBoxCellType
    Displays changed value with Message Box before closing

    ComboBoxCellType
    Displays changed value with Message Box before closing
    I'm a little confused by the insconsistency displayed among the events since
    it seems that all of them would have the same underlying SubEditor. So why
    do Message Boxes display properly in the ComboCloseUp event but not at all
    in the ComboSelChange event unless I use the alternate syntax which includes
    specifying the owner? Thanks in advance for any indeas and/or suggestions.


     
    2007/09/FpSpreadComboEventIssues-2.zip
  • Replied 8 September 2017, 12:47 pm EST

    Hello Kevin,


    Thanks for taking the time to elaborate, that was very helpful! Sounds like you guys are on it so I'm sure it will be resolved shortly.


    Worst case scenario, a little blurb could be added to the docs mentioning the need to use the alternate MessageBox syntax for the ComboSelChange event. Or maybe better, a small separate topic devoted to using Message Boxes within the FpSpread Combo events.

  • Replied 8 September 2017, 12:47 pm EST

    To generate the null reference error, check the ComboDropDown checkbox and then click somewhere in a cell in column 1 which has a MultiColumnComboBoxCellType. After the DropDown arrow is displayed, click one or more times in the active cell (Not on the DropDown arrow) and you will get the error. I have only had this issue with ComboDropDown.
  • Replied 8 September 2017, 12:47 pm EST

    The exception has been fixed and will be in the next maintenance release. The inconsistency issues will not be addressed for this release.
  • Replied 8 September 2017, 12:47 pm EST

    We will look into the non-message box related inconsistencies and see what is going on there.

    As for the MessageBox inconsistencies you are seeing. First thing to note is that the ComboBoxCellType and the MultiColumnComboBoxCellType are vastly different under the covers. The ComboBoxCellType uses an FpCombo for its editor and there is no sub editor for that celltype. The list is contained inside the FpCombo class which handles the displaying of the list. The MultiColumnComboBoxCellType uses a GeneralEditor for its Editor and has a subeditor which is derived from FpSpread. The displaying of the list for the MultiColumnComboBoxCellType is then handled by the GeneralEditor through the SubEditor mechanisms.

    As for the MessageBoxes displaying properly from the ComboBoxCloseUp vs the other events that would simply be due to the fact that the active window is different at the time of those events. During a ComboSelChange event the list is still going to be displayed so the active window is drop down window. That window however goes away immediately after the event so the MessageBox is destroyed immediately as well. In testing here with debug builds we see the MessageBox display for an instant before disappearing. In the case of the ComboCloseUp the list window has been destroyed and the active window has switched back to the Spread so the MessageBox owner is still available hence it displays fine.

  • Replied 8 September 2017, 12:47 pm EST

    Thanks Kevin, that will be great! Which exception are you referring to in your post above, the one thrown by the MultiColumnComboBoxCellType or the one thrown by ComboBoxCellType?

  • Replied 8 September 2017, 12:47 pm EST

    I believe the Combo exception was fixed prior to the reporting of this bug and the MultiColumnComboBox exception was fixed as a result of the report, or vice versa i don't recall. The end result is both should be fixed with the next release.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels