feat(grid): Copy cell menu for untruncated value#55
Merged
Conversation
Cells visually truncate at MAX_CELL_DISPLAY_CHARS, so a TextBlock- level Ctrl+C only saw the visible prefix. Added a 'Copy cell' item at the top of the data-grid context menu that pulls the FULL value from data_.rows directly — works regardless of how aggressively the cell is clipped for layout. Wire-up: - Each cell TextBlock now stamps Tag(int32 colIndex). - RightTapped on the row walks OriginalSource up the visual tree to find the cell TextBlock and stash its column in contextCol_. - Menu Opening gates the item on (selectedRow_ >= 0 && contextCol_ >= 0). - CopyCellToClipboard reads data_.rows[selectedRow_][colName] and ships a DataPackage with the full string. NULL sentinel renders as the literal 'NULL' so paste targets see something.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Long-text cells in the data grid visually truncate at
MAX_CELL_DISPLAY_CHARS(80 chars), so the TextBlock's underlying Text property only contains the prefix + ellipsis. Ctrl+C / drag-select therefore only copied the visible chars — the rest of the value was unreachable from the grid.Added a Copy cell item at the top of the right-click context menu that reads the full value from
data_.rowsdirectly and ships it to the clipboard.Implementation
Tag(int32 colIndex).RightTappedon the row walksOriginalSourceup the visual tree, picks up the cell's column index from the Tag, and stashes it incontextCol_.selectedRow_ >= 0 && contextCol_ >= 0.CopyCellToClipboardwritesdata_.rows[selectedRow_][colName](or literalNULLfor null cells) to aDataPackage.Test plan