C1FlexGrid Multi-Select in a ComboList

Posted by: jwhitney on 13 June 2018, 12:15 pm EST

    • Post Options:
    • Link

    Posted 13 June 2018, 12:15 pm EST

    When specifying a ComboList in a column, is it possible to allow multi-select or can only one item be selected?

  • Posted 14 June 2018, 4:21 am EST

    Hi,

    this is not possible.

    But you can use a custom editor (which should implement the IC1EmbeddedEditor interface):

    this.c1FlexGrid.Cols[myCol].Editor = new MyCustomEditor();

    See the C1 sample “CustomEditors” (https://www.grapecity.com/en/samples/customeditors).

    There is a C1 component “C1CheckList” (or “C1MultiSelect”?) in the “C1.Win.MultiSelect” assembly. Maybe you can use it as grid editor directly. If not you should subclass it and implement the “IC1EmbeddedEditor” interface.

    Hope this helps

    Wolfgang

  • Posted 14 June 2018, 11:59 pm EST

    Hi all!

    Thanks Wolfgang and Manindra.

    Jeff, you can go with the suggested solution using C1MultiSelect control. Also, here is the documentation link to the control :

    http://help.grapecity.com/componentone/NetHelp/multiselect/webframe.html#multiselectoverview.html

    But please note, C1MultiSelect control was introduced in 2018-V1 controls.

    Best regards,

    Meenakshi

  • Posted 15 June 2018, 5:29 am EST

    Hi jwhitney,

    The reply got deleted by mistake.

    You can use C1MultiSelect as editor in a C1FlexGrid Column to implement this scenario.

    C1MultiSelect _permissionEditor = new C1MultiSelect();

    c1FlexGrid1.Cols[2].Editor = _permissionEditor;

    I have created a simple example that demonstrates how to place C1MultiSelect inside C1InputPanel for multiple selection.

    Thanks,

    +Manindra

    MultiSelectEditorInFlex.zip

  • Posted 18 June 2018, 5:28 pm EST

    Thanks to all!

  • Posted 18 June 2018, 5:38 pm EST

    I set the C1FlexGrid Column Editor = C1MultiSelect1 (a hidden control on my form). It works ok, but requires a double-click in the cell in order to see the multi-select dropdown arrow, and then another click on the arrow to pull down the multi-select editor. Is there any way to A) Use the Editor field in this way (very simple), and B) Have the multi-select editor drop down with a single click in the cell (not a double-click and then a single)??

  • Posted 19 June 2018, 12:32 am EST

    Hi Jeff!

    In order to see this feature, you need to use AfterRowColChange and SetUpEditor events of the grid as follows :

    private void C1FlexGrid1_AfterRowColChange(object sender, RangeEventArgs e)
    {
                if (c1FlexGrid1.Cols[e.NewRange.c1].Editor is C1MultiSelect)
                {
                    c1FlexGrid1.StartEditing(e.NewRange.r1, e.NewRange.c1);
                }
    }
    
    private void C1FlexGrid1_SetupEditor(object sender, RowColEventArgs e)
    {
                if(c1FlexGrid1.Editor is C1MultiSelect)
                {
                    (c1FlexGrid1.Editor as C1MultiSelect).DroppedDown = true;
                }
    }
    

    Best regards,

    Meenakshi

Need extra support?

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

Learn More

Forum Channels