You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
I believe the EndEdit() function was intended to stop editing the current editing cell and then assign the existing data in the editing cell to cell.data. The edit.cs public bool EndEdit(object data) function was actually being passed the cell itself instead of cell.data.
Easy fix.
The function call needing a change is in Cell.cs
Line 944
Change:
this.worksheet.EndEdit(this);
To:
this.worksheet.EndEdit(this.Data);
Please let me know if this was the intention of the function. Thank you for a great open source project. It has been fun working with it.
Regards,
Mark
Last edited by ReoGridUser1222 (2017-02-14 18:12:44)
Offline
See Disclaimer at the bottom!!!!!!!
I ran across another issue with this function. The problem occurs when there is preexisting data in a cell that you want to start editing. Editing works great but if you are in the process of editing(a cell that already contained data) and you have to call up the EndEdit() funtion you will lose the new data that was in the cell and the old data will be contained in the cell.
Another simple fix:
Reogrid\core\worksheet\edit.cs
Line: 399-402
399 if(data == null)
400 {
401 data = this.controlAdapter.GetEditControlText();
402 {
Changed to:
399 //if(data == null)
400 //{
401 data = this.control.Adapter.GetEditControlText();
402 //}
I removed the check for null data because I do not care if there is already data in there because the user is already editing the cell which, in my opinion, means they intended to replace the data in the cell.
DISCLAIMER!!!!!!
This may not be the true intent of this function. I have altered this to suit my needs. This behavior comes down to personal preference. End edit could mean preserve data that has been in the cell unless the cell had no data or through my perspective i think end edit means close editing and capture what is currently in the cell no matter what.
Last edited by ReoGridUser1222 (2017-02-14 18:14:13)
Offline
Hi Mark,
Thanks for your improvements. Hope ReoGrid helps you.
If you use GitHub, we can merge your changes quickly and directly.
Thanks.
Jing
Offline