Possible issue with MultiColumnComboBoxCellType

Posted by: j2associates on 8 September 2017, 1:37 pm EST

  • Posted 8 September 2017, 1:37 pm EST

    Hello all,


    I created my own cell type by inheriting from MultiColumnComboBoxCellType. If I set a break point within the class, Me.BorderStyle returns None, but CType(e.SubEditor, fpSpread).BorderStyle returns Fixed3D. Shouldn't these 2 properties return the same value? Thanks in advance for any ideas and/or suggestions.

  • Replied 8 September 2017, 1:37 pm EST

    j2 -

    How are you checking CType(e.SubEditor, FpSpread).BorderStyle in the custom class?  It may be that the Border has not been created yet when checking it in the Class itself using Me.BorderStyle.

  • Replied 8 September 2017, 1:37 pm EST

    Hello BobM,


    I checked it in the SubEditorOpeningEvent.

  • Replied 8 September 2017, 1:37 pm EST

    How and where are you checking the Me.BorderStyle?  The MultiColumnComboboxCellType doesn't have a BorderStyle, whereas the editor does.
  • Replied 8 September 2017, 1:37 pm EST

    I subclassed from MultiColumnComboBoxCellType which exposes a BorderStyle property which I assumed would get passed into the editor.
  • Replied 8 September 2017, 1:37 pm EST

    Hello,


    Are you expecting the SubEditor to pick up on this property setting from the CellType? It will not do this.

  • Replied 8 September 2017, 1:37 pm EST

    Scott is correct. The Me you are referring to in code appears to be the cell editor (the editbox) and the SubEditor is the drop down. These are not the same object you are comparing.
  • Replied 8 September 2017, 1:37 pm EST

    Thanks to both of you for responding! Wouldn't it seem logical that the BorderStyle for a MultiColumnComboBoxCellType would refer to the SubEditor when it is dropped? Insofar as I know, that's the only time you have access to it.


    So are you basically saying that all of the properties displayed when you instantiate a MultiColumnComboBox are bogus unless you explicitly set them in SubEditorOpening? If only the explicit properties you have added are valid, could the rest be hidden so as not to confuse the issue?


     

  • Replied 8 September 2017, 1:37 pm EST

    I did the same and in the PaintCell override I checked the following and it returnded Fixed3D...

    Public Overrides Sub PaintCell(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single)
    Dim bs As System.Windows.Forms.BorderStyle = Me.ListBorderStyle

    MyBase.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor)
    End Sub

    I also checked it in the GetEditorControl and it returned Fixed3D as well.

  • Replied 8 September 2017, 1:37 pm EST

    Hello,


    You are doing somethnig else in your MultiColumnComboboxCellType class. This class does not have a BorderStyle property by default. The CellType object has an editor, render and possibly a subeditor. Each are different from one another. I am not sure what properties you are seeing on the MultiColumnCombobox class that you are expecting to also be set the same on the FpSpread that is the SubEditor.

  • Replied 8 September 2017, 1:37 pm EST

    Sorry for the confusion. The ListBorderStyle is what I should have been using.

Need extra support?

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

Learn More

Forum Channels