Skip to content

Commit

Permalink
Merge pull request #2526 from cwensley/curtis/wpf-treegridview-drag-c…
Browse files Browse the repository at this point in the history
…heck-expandable

Wpf: Ensure TreeGridItem is expandable before checking if Expanded is true
  • Loading branch information
cwensley committed Jul 17, 2023
2 parents 8d4f334 + 3e23ca9 commit ca2cd5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Eto.WinForms/CustomControls/TreeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void ResetSections()
for (int row = 0; row < Store.Count; row++)
{
var item = Store[row];
if (item.Expanded)
if (item.Expandable && item.Expanded)
{
var children = (ITreeGridStore<ITreeGridItem>)item;
var section = new TreeController { StartRow = row, Handler = Handler, parent = this };
Expand Down
2 changes: 1 addition & 1 deletion src/Eto.Wpf/Forms/Controls/TreeGridViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected override DragEventArgs GetDragEventArgs(sw.DragEventArgs data, object
{
position = GridDragPosition.After;
var treeGridItem = item as ITreeGridItem;
if (treeGridItem?.Expanded == true)
if (treeGridItem?.Expandable == true && treeGridItem?.Expanded == true)
{
// insert as a child of the parent
parent = item;
Expand Down

0 comments on commit ca2cd5d

Please sign in to comment.