Hi all,
today we updated to last version of Wisej 2.1.42.
We have some problem with Clipboard.
Here the simple line that we are using:
Clipboard.SetClientText(textToCopy);
We noted that is not working in builds: 2.1.13 – 2.1.22 – 2.1.42
Thanks for any help.
You are correct, sorry. I didn’t know that it worked also from the server side. It’s a regression caused by a change in the selection of the text in the elements – it used to grab the focus and now it doesn’t, which is correct but it broke the document.executeCommand(“copy”). Will fix. Do you need a workaround?
Hi Simone,
it´s fixed in Wisej release 2.1.43.
Best regards
Frank
Hi Luca,
thanks for you answer.
Right now we are doing this operation in response of a user event, in particular when user double click a cell of a DataGridView.
Here the complete code:
private void GridPratiche_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Left) { int columnIndex = e.ColumnIndex; if (gridPratiche.SelectedRows.Count > 0 && gridPratiche.Columns.ElementAtOrDefault(columnIndex) != null) { DataGridViewCell cell = gridPratiche.SelectedRows[0].Cells[columnIndex]; if (cell.Value != null) { string textToCopy = cell.Value.ToString(); Clipboard.SetClientText(textToCopy); AlertBox.Show("Copiato il testo '" + textToCopy + "'" + Environment.NewLine + "Colonna " + cell.OwningColumn.HeaderText + ".", MessageBoxIcon.Information, true, ContentAlignment.BottomRight, 2000); } } } }
And why until version 2.0.54.0 is working fine ?
Thanks for your help.
It is not enough to send the text to the browser, you need to copy it to the browser’s clipboard in response of a user event (a click). All browsers, except IE probably, block any access to the clipboard unless it’s directly initiated by a user action. That’s why all websites that copy text to the clipboard have a little copy button to click.
With Wisej you can send the text to the browser using Clipboard.SetClientText(textToCopy), then you can copy to the browser’s clipboard using Wisej.Core.copy() in response to a client click event. You can attach a client event using ClientEvents, add a “execute” handler and run Wisej.Core.copy();
See also:
Please login first to submit.