Cancel changes to drop cells in FlexGrid bug

Posted by: mporch on 17 October 2017, 12:51 am EST

    • Post Options:
    • Link

    Posted 17 October 2017, 12:51 am EST

    Hi,

    I’m working with the C1Flexgrid using EntityFramework to bind the data to it and everything is as I’d expect it to be except for one thing. I have a column which has been set up to use the dropdown facility with the Flexgrid by using:

    [C1DataSource].GetControlHandler(flxgGrid).AutoLookup=true;

    This column behaves as expected until I’ve made a change to one of the dropdown cells and want to cancel it without saving anything to the database.

    The client cache seems to want to hang onto the new value and the C1Flexgrid keeps showing the new value even after the form has been closed and a new instance subsequently opened. Other normal columns revert to their original value, but not the dropdown one.

    I’ve tried RejectChanges, Refresh, but to no avail. I’m probably missing something obvious, but any help would be gratefully received!

    Thanks,

    Mark.

  • Posted 17 October 2017, 7:31 pm EST

    Hi Mark,

    Di you try using the C1DataSource’s SavingChanges event or the C1FlexGrid Edit events for canceling the change made to the drop-down column.

    Also, you may even wish to clear the cache using Clear method.

    Following are few documentation links that you might wish to refer:

    http://help.grapecity.com/componentone/NetHelp/EFDataSource/C1.Data.Entity.4~C1.Data.ClientCacheBase_members.html

    http://help.grapecity.com/componentone/NetHelp/c1flexgrid/C1.Win.C1FlexGrid.4~C1.Win.C1FlexGrid.C1FlexGridBase~LeaveEdit_EV.html

    http://help.grapecity.com/componentone/NetHelp/c1flexgrid/C1.Win.C1FlexGrid.4~C1.Win.C1FlexGrid.C1FlexGridBase~ValidateEdit_EV.html

    However, if this does not help , then it would be great if you could share a stripped version of your application, so that we could help better looking into your sample.

    Thanks,

    Ruchir Agarwal

  • Posted 23 October 2017, 7:06 pm EST

    Hi Ruchir,

    Thanks for your reply.

    I’ve tried using RejectChanges and I can see it reverting the changed value in the combo back to the original value when I step through the code. The result is the combo correctly showing the original value. However, when I remove the breakpoints and allow the code to run, the new value is not rejected and is still shown in the combobox. I don’t understand why stepping through the code and allowing it to run should produce a different result.

    Regards,

    Mark.

  • Posted 24 October 2017, 1:16 am EST

    Hi Ruchir,

    I’ve managed to figured it out: -

    [C1DataSource].ClientScope.Dispose();

    that’s it. I don’t have to call the Reject or Clear methods

    Regards,

    Mark.

Need extra support?

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

Learn More

Forum Channels