GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

ComboBoxCellType to all column

Last post 02-09-2010, 10:33 AM by SureshD. 1 replies.
Sort Posts: Previous Next
  •  02-09-2010, 2:42 AM 87167

    ComboBoxCellType to all column

    Hello,

    I want define column to comboBox. I write this code:

    private static void prvLoadCombobox(ComboBoxCellType linkCombo, ParamInfo paramInf)

    {

    string name;

    int val;

    string[] items, itemData;

    items = new string[paramInf.NumOptions];

    itemData = new string[paramInf.NumOptions];

    for (int eachItem = 0; eachItem < paramInf.NumOptions; eachItem++)

    {

    paramInf.GetOption(eachItem, out name, out val);

    items[eachItem] = name;

    itemData[eachItem] = val.ToString();

    }

    linkCombo.Items = items;

    linkCombo.ItemData = itemData;

    linkCombo.EditorValue = EditorValue.ItemData;

    linkCombo.MaxDrop = Defines.MAX_DROP_LINKS;

    }

    But when using the comboBox in the first time I can open it and close it without select any item.

    After the first selection always one of the option is selected.

    I need that to fix the first time. How I do it?

    Filed under:
  •  02-09-2010, 10:33 AM 87184 in reply to 87167

    Re: ComboBoxCellType to all column

    Sim,

    I used the below snippet to set a combobox column and I did not see the behavior as described by you.

            Dim cbox As New FarPoint.Win.Spread.CellType.ComboBoxCellType
            Dim str() As String
            str = New String() {"One", "Two"}
            cbox.Items = str
            FpSpread1.Sheets(0).Columns(0).CellType = cbox

    I used VB.net, you can convert the above to equivalent C# code using this one of many online sites available.


    Suresh Singh Dasila
    GrapeCity FarPoint
View as RSS news feed in XML
     FarPoint Forums Home