Skip to content

Commit

Permalink
fixed an issue with get cels content process
Browse files Browse the repository at this point in the history
  • Loading branch information
w-ahmad committed Jun 17, 2024
1 parent ee12d83 commit e388865
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/WinUI.TableView/TableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public string GetSelectedContent(bool includeHeaders, char separator = '\t')
slots = SelectedRanges.SelectMany(x => Enumerable.Range(x.FirstIndex, (int)x.Length))
.SelectMany(r => Enumerable.Range(0, Columns.VisibleColumns.Count)
.Select(c => new TableViewCellSlot(r, c)))
.Concat(SelectedCells)
.OrderBy(x => x.Row)
.ThenByDescending(x => x.Column);
}
Expand All @@ -278,7 +279,6 @@ public string GetAllContent(bool includeHeaders, char separator = '\t')
var slots = Enumerable.Range(0, Items.Count)
.SelectMany(r => Enumerable.Range(0, Columns.VisibleColumns.Count)
.Select(c => new TableViewCellSlot(r, c)))
.Concat(SelectedCells)
.OrderBy(x => x.Row)
.ThenByDescending(x => x.Column);

Expand All @@ -287,6 +287,11 @@ public string GetAllContent(bool includeHeaders, char separator = '\t')

private string GetCellsContent(IEnumerable<TableViewCellSlot> slots, bool includeHeaders, char separator)
{
if (!slots.Any())
{
return string.Empty;
}

var minRow = slots.Select(x => x.Row).Min();
var maxRow = slots.Select(x => x.Row).Max();
var minColumn = slots.Select(x => x.Column).Min();
Expand Down

0 comments on commit e388865

Please sign in to comment.