Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
Martin
Created on: 30 Jul 2022 10:36
Category: UI for WinForms
Type: Bug Report
0
Unused local in BaseGridNavigator.SelectAllCells

Searching for a workaround for a previously reported bug, in walked into a little thing:


private void SelectAllCells()
    {
      GridViewRowInfoEnumerator rowInfoEnumerator = new GridViewRowInfoEnumerator((IHierarchicalRow) this.GridViewElement.Template);
      List<GridViewCellInfo> gridViewCellInfoList = new List<GridViewCellInfo>();
      this.MasterTemplate.SelectedCells.BeginUpdate();
      this.MasterTemplate.SelectedCells.Clear();
      while (rowInfoEnumerator.MoveNext())
      {
        GridViewRowInfo current = rowInfoEnumerator.Current;
        if (current.CanBeSelected)
        {
          foreach (GridViewCellInfo cell in current.Cells)
            this.MasterTemplate.SelectedCells.Add(cell);
        }
      }
      this.MasterTemplate.SelectedCells.EndUpdate(true);
    }
The local gridViewCellInfoList is never used and can therefore be removed, improving performance and memory usage in very very very small way.
1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 01 Aug 2022 10:43

Hi Martin,

Thank you for pointing this out. We always aim to improve the performance of our controls in any way. The unused local variable will be removed. Your Telerik Points are updated.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.