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.
Hi!
Is there a simple way to clear only values in range, leaving formats and formulas intact?
If not, treat it like improvement suggestion
-boldtm
Offline
Hi boldtm, try ClearRangeContent and pass the second argument as Data. This method provides the functionality to clear content from specified range, content could be specified (data, formula, data format, style, border and etc...).
sheet.ClearRangeContent("A1:B5", CellElementFlag.Data);
Or use DeleteRangeData method.
sheet.DeleteRangeData(new ReoGridRange("A1:B5"));
If you want this deleting operation could be undone, use this:
grid.DoAction(new RemoveRangeDataAction(new ReoGridRange("A1:B5")));
Edit: sorry, I've checked the ClearRangeContent with argument CellElementFlag.Data, it deletes formula. I think it is impossible to delete data but formula, even if it is possible, the cell will be updated instantly and the data of formula's value will be displayed again if any referenced cell was updated. What's case of you want do this?
Jing
Last edited by Jingwood (2015-01-29 12:14:31)
Offline
It's OK for me to leave computed values in cells with formulas. I didn't mean getting grid blank.
I'd like to use grid as a form: fill some cells, automatically get in other cells computed values and print it all.
I thought about something like this in OpenOffice https://wiki.openoffice.org/wiki/Docume … l_Contents. Based on specified flag only selected properties are cleared.
I suppose ClearRangeContent is exactly what I'm looking for.
Thanks, for fast and thorough answer.
Last edited by boldtm (2015-01-29 16:18:58)
Offline