I'm wondering if anyone else has ran into this issue.
I'm having an issue when copying data from the XamGrid to the clipboard. I have a template column that contains a hyperlink control that represents a customer # in our database. I allow the users to select columns and rows that they want to copy and then click ctrl-c to copy the data to the clipboard. But when they paste it into excel, word, notepad, etc., the customer # column is blank. The header is there, but the data is not. How can keep the column a hyperlink and have the actual data present for export?
Below is the code for template column as well as the class that is used to convert the value into an URI.
Thanks
Using the below code, I do have the customer # column appearing the way that I want and the hyperlink works as expected.
When I copy / paste the grid into excel, the customer number column ends up being the value of the url, not the customer #. Is there a way to have the customer # copied instead of the url?
New grid with column displaying column number that is a hyperlink.
I'm selecting all the rows and clicking ctrl-c to copy the data from the grid.
Hello Lonnie3072,
I have been looking into your post and I understand your concerns. In your case the HyperlinkColumn refers to property ‘CustomerNumber’ that does not return an URI. In order to achieve the functionality that you want you can use ValueConverter like:
<ig:HyperlinkColumn Key="CustomerNumber" ValueConverter=”{StaticResource Conv}” HeaderText="Customer #" TargetName="_blank"></ig:HyperlinkColumn>
If you need any further assistance, feel free to ask.
In your data datasource, you have a string property that contains the url.
In my project, I'm using a converter class that returns the url as a string. I can return that string to both content and contentbinding and see it in the column. The url is underlined when the mouse hovers over it indicating it's a hyperlink, but nothing happens once you click it. I've attached a small screenshot of one of the link's being highlighted. I've also attached my code for the column and the Converter class that I'm using.
Hyperlink Column Code
<ig:HyperlinkColumn Content="{Binding CustomerNumber, Converter={StaticResource Conv}}" ContentBinding="{Binding CustomerNumber, Converter={StaticResource Conv}}" Key="CustomerNumber" HeaderText="Customer #" TargetName="_blank"></ig:HyperlinkColumn>
Converter Class
public class Conv : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
if (value is int)
string sCSHURL = "../customerservicehistory/search.aspx?QueryCustomerID={0}";
if (App.Current.Resources.Contains("CSHURL"))
sCSHURL = App.Current.Resources["CSHURL"].ToString() + "={0}";
}
return string.Format(sCSHURL, value);
return null;
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
throw new NotImplementedException();
Hello loonie3072,
I have been looking into your post. Do you mean that you cannot make the values into the HyperlinkColumn behave as hyperlinks? If it is so I have managed to achieve that in the sample application(XamGridHyperlinkModified.zip) that I have attached in my previous post.
I am looking forward to hearing from you.
I'm still having an issue with it. I've tried passing an Uri and a string of the url to the content property, but it doesn't become a hyperlink. At least when it is clicked, nothing happens. Any suggestions?