Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ReoGrid/Worksheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ public void FreezeToCell(int row, int col)
////}
}

private CellPosition lastFrozenPosition;
private FreezeArea lastFrozenArea = FreezeArea.None;

/// <summary>
/// Freezes worksheet at specified cell position and specifies the freeze areas.
/// </summary>
Expand All @@ -437,6 +440,18 @@ public void FreezeToCell(int row, int col)
/// <param name="area">Specifies the frozen panes.</param>
public void FreezeToCell(int row, int col, FreezeArea area)
{
/////////////////////////////////////////////////////////////////
// fix issue #151, #172, #313
if (lastFrozenPosition == new CellPosition(row, col) && lastFrozenArea == area)
{
// skip to perform freeze if forzen position and area are not changed
return;
}

lastFrozenPosition = new CellPosition(row, col);
lastFrozenArea = area;
/////////////////////////////////////////////////////////////////

if (this.viewportController != null)
{
// update viewport bounds - sometimes the viewport may cannot get the correct size for freezing,
Expand Down