Skip to content

Commit

Permalink
Fixes for virtualization with our use of the TreeDataGrid (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari authored Sep 12, 2024
1 parent 8b7f014 commit 9169f04
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ protected override string GetDataRecycleKey(object? data)

switch (data)
{
case IIndentedRow:
case IIndentedRow { Indent: 0 }:
{
var rowKey = $"{base.GetDataRecycleKey(data)}|{RootRowClass}";
return string.Intern(rowKey);
}
case ICustomCell customCell:
{
// NOTE(Al12rs): the keys generated here should match the ones in GetElementRecycleKey, ensure order and format is the same
Expand All @@ -63,7 +65,7 @@ protected override string GetElementRecycleKey(Control element)

var sb = new StringBuilder(value: base.GetElementRecycleKey(element));

if (element is not TreeDataGridCell or TreeDataGridRow)
if (element is not TreeDataGridCell and not TreeDataGridRow)
return string.Intern(sb.ToString());

// NOTE(Al12rs): Order here should match the insertion order in CreateElement, first the id, then the RootRowClass
Expand Down

0 comments on commit 9169f04

Please sign in to comment.