Persist grid SizeMode in BandLayout for layout restore
Added SizeMode property to BandLayout in both CatalogsGrid.razor and MassDataGrid.razor. The grid's current SizeMode is now saved and restored with the layout, ensuring user preferences for grid sizing persist across sessions. This improves the consistency of the user experience when reloading or switching layouts.
This commit is contained in:
@@ -515,6 +515,7 @@ else
|
||||
|
||||
var layout = gridRef.SaveLayout();
|
||||
bandLayout.GridLayout = layout;
|
||||
bandLayout.SizeMode = _sizeMode;
|
||||
|
||||
var orderedColumns = layout.Columns
|
||||
.Where(column => !string.IsNullOrWhiteSpace(column.FieldName))
|
||||
@@ -552,6 +553,7 @@ else
|
||||
|
||||
columnBandAssignments = BuildAssignmentsFromLayout(bandLayout);
|
||||
ApplyColumnLayoutFromStorage();
|
||||
_sizeMode = bandLayout.SizeMode;
|
||||
UpdateBandOptions();
|
||||
}
|
||||
|
||||
@@ -754,6 +756,7 @@ else
|
||||
public List<string> ColumnOrder { get; set; } = new();
|
||||
public Dictionary<string, string?> ColumnWidths { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public GridPersistentLayout? GridLayout { get; set; }
|
||||
public DevExpress.Blazor.SizeMode SizeMode { get; set; } = DevExpress.Blazor.SizeMode.Medium;
|
||||
}
|
||||
|
||||
private sealed class BandDefinition
|
||||
|
||||
@@ -363,6 +363,7 @@ else
|
||||
|
||||
columnBandAssignments = BuildAssignmentsFromLayout(bandLayout);
|
||||
ApplyColumnLayoutFromStorage();
|
||||
_sizeMode = bandLayout.SizeMode;
|
||||
UpdateBandOptions();
|
||||
}
|
||||
|
||||
@@ -403,6 +404,7 @@ else
|
||||
|
||||
var layout = gridRef.SaveLayout();
|
||||
bandLayout.GridLayout = layout;
|
||||
bandLayout.SizeMode = _sizeMode;
|
||||
|
||||
var orderedColumns = layout.Columns
|
||||
.Where(column => !string.IsNullOrWhiteSpace(column.FieldName))
|
||||
@@ -416,6 +418,8 @@ else
|
||||
bandLayout.ColumnWidths = orderedColumns
|
||||
.Where(column => !string.IsNullOrWhiteSpace(column.Width))
|
||||
.ToDictionary(column => column.FieldName, column => column.Width, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
bandLayout.SizeMode = _sizeMode;
|
||||
}
|
||||
|
||||
private async Task ResetBandLayoutAsync()
|
||||
@@ -764,6 +768,7 @@ else
|
||||
public List<string> ColumnOrder { get; set; } = new();
|
||||
public Dictionary<string, string?> ColumnWidths { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public GridPersistentLayout? GridLayout { get; set; }
|
||||
public DevExpress.Blazor.SizeMode SizeMode { get; set; } = DevExpress.Blazor.SizeMode.Medium;
|
||||
}
|
||||
|
||||
private sealed class BandDefinition
|
||||
|
||||
Reference in New Issue
Block a user