Subeditor Celltype

Posted by: kbj on 21 December 2022, 9:49 am EST

    • Post Options:
    • Link

    Posted 21 December 2022, 9:49 am EST - Updated 21 December 2022, 9:54 am EST

    I am trying to create a celltype with a subeditor that works in a very specific way.

    The cell contents can only be changed by selecting options from the sub editor.

    I would like the subeditor to be shown immediately when the users enters the cell.

    Example:

  • Posted 21 December 2022, 11:18 pm EST

    Hi Kingman,

    You can create a custom subeditor by creating a form that implements the ISubEditor interface. The instance of the custom SubEditor can then be set to the SubEditor property of the CellType. Please see the following code for the same:

    GeneralCellType generalCellType = new GeneralCellType();
    fpSpread1.Sheets[0].Cells[1, 1].CellType = generalCellType;
    generalCellType.SubEditor = new CustomCellEditor();
    generalCellType.DropDownButton = true;
    fpSpread1.SubEditorClosed += (editorSender, editorEventArgs) =>
    {
        (editorSender as FpSpread).ActiveSheet.Cells[editorEventArgs.Row, editorEventArgs.Column].Value = (editorEventArgs.SubEditor as CustomCellEditor).GetValue();
    };

    Kindly refer to the attached sample for full implementation. (See CustomCellSubEditor_Mod.zip)

    Thanks & Regards,

    Aastha

  • Posted 22 December 2022, 1:15 am EST

    Hi Aastha,

    I am aware of how to create a custom sub editor (and it’s a great tool for the spreadsheet)

    My requirements as I stated above are:

    The cell contents can only be changed by selecting options from the sub editor.

    (the actual cell contents eg. the text “Yellow Male” cannot be edited in the cell editor.)

    I would like the subeditor to be shown immediately whenever the users enters the cell.

    (no need for a drop down button)


    Regards,

    Kingman

  • Posted 25 December 2022, 5:28 am EST

    Hi Kingman,

    We are working on your requirement and will get back to you soon on this.

    Regards,

    Aastha

  • Posted 25 December 2022, 5:28 pm EST

    Hi Kingman,

    The attached sample demonstrates setting the cell value using the subeditor only.

    Please refer to CustomCellSubEditor_Mod1.zip for the same.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels