Browse Source
Merge pull request #8592 from timunie/fix/DataGridCopyMulitlineContent
Improve DataGrid CSV export (copy & paste)
pull/10627/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
src/Avalonia.Controls.DataGrid/DataGrid.cs
|
|
|
@ -6066,8 +6066,9 @@ namespace Avalonia.Controls |
|
|
|
var numberOfItem = clipboardRowContent.Count; |
|
|
|
for (int cellIndex = 0; cellIndex < numberOfItem; cellIndex++) |
|
|
|
{ |
|
|
|
var cellContent = clipboardRowContent[cellIndex]; |
|
|
|
text.Append(cellContent.Content); |
|
|
|
var cellContent = clipboardRowContent[cellIndex].Content?.ToString(); |
|
|
|
cellContent = cellContent?.Replace("\"", "\"\""); |
|
|
|
text.Append($"\"{cellContent}\""); |
|
|
|
if (cellIndex < numberOfItem - 1) |
|
|
|
{ |
|
|
|
text.Append('\t'); |
|
|
|
|