This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We have a small problem but it is very important to our customer for ctrl + c on datagrid: If the DataGrid is binding to the collection, for every record, there is a field which is Guid, when we display the records, we switch it to string value that is related to the Guid value (using converter). The display is fine as in the following screen shot (see loaded image display.jpg). But when user select the records and uses Ctrl + C to copy selected records, then paste it to excel, it shows the Guid value on the field instead of the displayed string value as:
See the 2nd column, it shows the Guid not the string value. I went to check your source code to see how did you do the ctrl +c , but I cannot find the source code. How did you do the copy to the clipboard for selected rows? Or you got it free from ItemsControl? |
|
|
Hello Gordon The copy feature pulls the values from the raw model object of each row and use bindings or property info of each column to get the cell values. The ToString function is called on each cell object and put in the clipboard. Unfortunately converters in view templates are not accessible by the copy function. The easiest way to work around this would be to have an additional property on your row objects that return the appropriate string version of the Guid value. The existing property that returns the guid can be used internally where you need it, but the DataGrid can point to the string property instead. -Jason Fauchelle |
|