Problem with edit mode of custom cell type when switching from v7.35 to 12.45

Posted by: mayank1158336 on 11 December 2019, 8:37 am EST

    • Post Options:
    • Link

    Posted 11 December 2019, 8:37 am EST - Updated 30 September 2022, 1:40 pm EST

    I am getting a crash while trying to edit the cell, we are using a wrapper over EditBaseCellType and using an instance of Windows.forms inside it.

    The issue happens when we edit the cell for the first time and StopEditing event gets calls Dispose() for the base class, where the control gets disposed.

    Next time when we try to access control we get the crash, this issue was not happening in v7.35 and happens only after the upgrade.

    if I override the InitializeEditorControl and instantiate the form object there the issue gets resolved,

    is this the right way to do?

    I am providing the methods

    public override Control GetEditorControl(FarPoint.Win.Spread.Appearance appearance, float zoomFactor)

    { UserControl ResultNumeric accept = null;

    accept.LessThan = false;

    accept.GreaterThan = false;

    accept.NumericResult = 0;

    accept.NumericResultString = " ";

    accept.SetResultFormat(m_dataMapMin, m_dataMapMax, m_dataMapDec);

    accept.SciNotationItemName = this.SciNotationItemName;

    accept.SuppressGreaterLessThan = this.SuppressGreaterLessThan;

    accept.AssayName = this.AssayName;

    return accept;

    }

    // this implementation resolves the issue

    public override void InitializeEditorControl(Control control, FarPoint.Win.Spread.Appearance appearance, float zoomFactor)

    {

    accept = new ResultNumeric();

    base.InitializeEditorControl(control, appearance, zoomFactor);

    }

    public override Control GetEditorControl(FarPoint.Win.Spread.Appearance appearance, float zoomFactor)

    {

    base.GetEditorControl(appearance, zoomFactor);

    accept.LessThan = false;

    accept.GreaterThan = false;

    accept.NumericResult = 0;

    accept.NumericResultString = " ";

    accept.SetResultFormat(m_dataMapMin, m_dataMapMax, m_dataMapDec);

    accept.SciNotationItemName = this.SciNotationItemName;

    accept.SuppressGreaterLessThan = this.SuppressGreaterLessThan;

    accept.AssayName = this.AssayName;

    return accept;

    }

  • Posted 16 December 2019, 2:06 am EST

    Hi,

    It seems you have created another forum post for the same concern. So, we are marking this case as duplicate of https://www.grapecity.com/forums/spread-winforms/problem-with-edit-mode-of-_1

    ~Ruchir

Need extra support?

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

Learn More

Forum Channels