Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
Detect cell change/delete in active SpreadSheet
posted

Hi,

We are implementing Dirty flag detection into XamSpreashead control but we face problems to detect early change/delete/add actions. We attached to WorksheetDirtied event but this event is raised even when scroll is changed thus does not fit to our needs.

Additionally, checking received argument event SpreadsheetWorkbookDirtiedEventArgs does not bring any value either since has no additional information about cell (old and new value, added or deleted or changed, nor address of cell itself).

Currently we need to serialize and deserialize all workbook to achieve this and this very expensive operation since we might have very big worksheets (50+ Mb).

How to detect when cell is starting to change?

What value has changed to and what was before?

What was the action of the cell: delete or add?

What was the address of the Cell and in which worksheet?

Thanks in advance,

Tomas

Parents
No Data
Reply
  • 2680
    Verified Answer
    Offline posted

    Hello,

    I have been looking into your question and after an investigation, I determined that there is no such event provided out of the box. I have implemented some custom logic to achieve similar behavior and get information like new value, old value, current worksheet, address, etc. of the edited cell.

    I defined a struct called ChangedCell which stores information about the cell as per your requirements. In order to retrieve the currently active cell, on which editing or deletion may be executed I handle the ActiveCellChanged event of the XamSpreadsheet. From there the initial cell info, such as a worksheet, row, column, address and current value, could be get.
    If the cell was edited, its new value can be retrieved from the EditModeExiting event of the XamSpreadsheet.
    In order to detect if the cell was deleted, the KeyUp event of the XamSpreadsheet can be handled. If there is an active cell selected and the pressed key is "Delete", we know the cell was deleted.

    I have attached a sample application, that uses the approach below.

    Please keep in mind that the suggested approach is a workaround and in case it is not an accurate demonstration of what you are trying to achieve, my suggestion is submitting a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com >.

    There are many benefits to submitting a product idea:

    - Direct communication with our product management team regarding your product idea.

    - Notifications whenever new information regarding your idea becomes available.

    - Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.

    - Allow you to shape the future of our products by requesting new controls and products altogether.

    - You and other developers can discuss existing product ideas with members of our Product Management team.

    If you require any further assistance on the matter, please let me know.

    Sincerely,
    Bozhidara Pachilova
    Associate Software Developer

    4747.XSDetectChangedCells.zip

Children