Browse Source
Merge pull request #4299 from ShadowDancer/fixes/4298-collapse-datagird-column-after-edit
Force recalculation of column width after edit is completed
pull/4333/head
Nikita Tsukanov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
src/Avalonia.Controls.DataGrid/DataGrid.cs
|
|
|
@ -3922,6 +3922,12 @@ namespace Avalonia.Controls |
|
|
|
dataGridCell: editingCell); |
|
|
|
|
|
|
|
EditingRow.InvalidateDesiredHeight(); |
|
|
|
var column = editingCell.OwningColumn; |
|
|
|
if (column.Width.IsSizeToCells || column.Width.IsAuto) |
|
|
|
{// Invalidate desired width and force recalculation
|
|
|
|
column.SetWidthDesiredValue(0); |
|
|
|
EditingRow.OwningGrid.AutoSizeColumn(column, editingCell.DesiredSize.Width); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// We're done, so raise the CellEditEnded event
|
|
|
|
|