IsTextSelectionEnabled in DataGrid HyperLink Column
Hello,
I would like to know if theres a possibility to get a property like IsTextSelectionEnabled for Grid:GridHyperlinkColumn .
I would like to select the text of an Hyperlink column, and i guess theres is no such property. Is there a workaround like copying the tooltip?
I know that you can select the cell and then press control c, but this is not a great idea for people that dont use computers so much
Thanking you in advance,
Regards,
Brice
SIGN IN To post a reply.
3 Replies
MA
Mohanram Anbukkarasu
Syncfusion Team
November 22, 2019 01:47 PM UTC
Hi Brice,
Thanks for contacting Syncfusion support.
SfDataGrid doesn’t have any property to enable selection for the hyperlink as per your requirement. From the provided details, we suspect that your requirement is to copy the hyperlink content to the clipboard. It is possible to get the value of the current cell in SfDataGrid and set it as the clipboard content. In the following code example we have copied the hyperlink content to the clipboard when the cell is tapped.
Code example :
|
this.dataGrid.CellTapped += DataGrid_CellTapped;
private void DataGrid_CellTapped(object sender, Syncfusion.UI.Xaml.Grid.GridCellTappedEventArgs e)
{
if (e.Column.MappingName == "Country")
{
string text = e.Record.GetType().GetProperty(e.Column.MappingName).GetValue(e.Record).ToString();
if (text.Length > 0)
Clipboard.SetText(text);
}
} |
We have prepared a sample using the above code example and it is available in the following link for your reference.
Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfDataGrid_Hyperlink913191194
Please let us know if your require further assistance from us.
Regards,
Mohanram A.
BY
Brice Yoan Chaton
December 12, 2019 07:49 AM UTC
Hello,
I wanted to try your example, but i don't have the event CellTapped, only CurrentCellActivated, which is not triggered when the cell is selected
"SfDataGrid does not contain a definition for 'CellTapped' and no extension method...
Thank you for your help
MA
Mohanram Anbukkarasu
Syncfusion Team
December 13, 2019 11:30 AM UTC
Hi Brice,
Thanks for the update.
You have selected the platform as WPF, and SfDataGrid WPF contains the CellTapped event. Please refer the below screenshot and reference link.
Please confirm us on the platform and the Syncfusion product version you are using.
Regards,
Mohanram A
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
BY Brice Yoan Chaton
- Nov 21, 2019 03:27 PM UTC
- Dec 13, 2019 11:30 AM UTC