Checking Type of Column

Posted by: sheritt on 8 September 2017, 1:49 pm EST

  • Posted 8 September 2017, 1:49 pm EST

    Hi,


    I have a grid that has several combobox columns.   I am trying to go through them and see which one is a combo box.


    When I step through the code, " <FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> col.CellType </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Is</FONT></FONT><FONT size=2> cell </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then" below, it shows that both col.celltype and cell are both combobox types, but it doesn't enter the procedure after evaluating.</FONT></FONT>


    <FONT color=#0000ff>What am I doing wrong?</FONT>


    <FONT color=#0000ff>Thanks</FONT>

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Dim</FONT></FONT><FONT size=2> i </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Integer

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> cell </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Spread.CellType.ComboBoxCellType


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> cCbo </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> cComboBoxes(ConnectionString)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> col </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> FarPoint.Win.Spread.Column

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>For</FONT></FONT><FONT size=2> i = 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>To</FONT></FONT><FONT size=2> mfpGrd.ActiveSheet.ColumnCount - 1


    col = mfpGrd.ActiveSheet.Columns(i)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> col.CellType </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Is</FONT></FONT><FONT size=2> cell </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then

    </FONT></FONT><FONT size=2>

    cCbo.ColumnNumber = i


    cFields.ComboTable = mcPhoneType</FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>

    </FONT></FONT><FONT size=2>

    cCbo.FillSpreadCombo()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Next

    </FONT></FONT>
  • Replied 8 September 2017, 1:49 pm EST

    Hello,


    The code looks correct. However, I thought you were using MultiColumnComboboxCellType for your columns. If you are assigning the CellType at the column level and the CellType is the ComboboxCellType, then your code should work. Could you post a small zipped project reproducing the issue for us to debug?

Need extra support?

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

Learn More

Forum Channels