Objective Grid: Validating data pasted from the clipboard

Article ID: 721
Last updated: 11 Jun, 2018
Article ID: 721
Last updated: 11 Jun, 2018
Revision: 3
Views: 4124
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How can I adjust and validate cells when I paste data from the clipboard? OnValidateCell() is not called.


Cause



Action


OnValidateCell will not be called when you paste text into cells, because the OnValidateCell() is only fired when you leave the current cell.

When you paste data into a range of cells, the method CGXControl::StoreStyle() will be called for each affected cell. CGXControl::StoreStyle() will call CGXGridCore::StoreStyleRowCol(). So, you can override any of these two methods to validate the pasted data.

When you paste data in CF_TEXT format into the grid, CGXControl::SetControlText() will be called for every cell. So, when you implement your own controls, you can override this method to validate and adjust the input before it is stored in the cell.

When data are copied to clipboard in CF_TEXT format, CGXControl::GetControlText() will be called to determine the text to be copied to the clipboard for each cell.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 721
Last updated: 11 Jun, 2018
Revision: 3
Views: 4124
Posted: 23 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category