SanthoshKumar SanthoshKumar - 2 months ago 17
C# Question

Copy cell content to clipboard RadGridView WPF

I'm working in

where i need to copy the cell content.

As part of the application functionality, i want the Grid
to always be of type
. In addition to this, we also want to expose a mechanism where the user can select a cell value for copy to clipboard.

Is there a way to do this? For example, double clicking a cell copies the cell value where as single click always selects the row.


Try this,

Not a perfect one, but for your requirement it suits.

void testGridView_CopyingCellClipboardContent(object sender, GridViewCellClipboardEventArgs e)
    if (grdName.CurrentCell != null && grdName.CurrentCell.Column == e.Cell.Column)
        e.Cancel = false;
        e.Cancel = true;

Where replace your GridView name with "grdName".