You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expanding the bottom item in a TreeGridView will expand when the expansion arrow is clicked, also running the relevant event.
Actual Behavior
The element is not expanded.
The Expanding event of the TreeGridView is not called.
Steps to Reproduce the Problem
Click the expand button on the bottom element of a TreeGridView
Code that Demonstrates the Problem
public partial class MainForm : Form
{
// counter for uniquely identifying items in the TreeGridView
int counter = 0;
public MainForm()
{
// basic stuff
Title = "Eto Forms TreeGridView Bug";
MinimumSize = new Size(800, 800);
// create the grid view, add a column to show the text
var gridView = new TreeGridView();
Content = gridView;
gridView.Columns.Add(new GridColumn{HeaderText = "Text", DataCell = new TextBoxCell(0)});
// create a new item collection, add a CollectionChanged callback to reload the node once added, and add an initial item.
var gridViewItems = new TreeGridItemCollection();
gridView.DataStore = gridViewItems;
gridViewItems.CollectionChanged += (sender, e) => {
if(e.NewItems == null) {
return;
}
foreach(var i in e.NewItems) {
System.Console.WriteLine("Reloading node " + (i as TreeGridItem).Values[0]);
gridView.ReloadItem(i as TreeGridItem);
}
};
var parentNode = new TreeGridItem{Values = new object[]{"test_parent" + counter}};
parentNode.Children.Add(new TreeGridItem{Values = new object[]{"test_child" + counter}});
counter++;
gridViewItems.Add(parentNode);
// callback to telegraph when expanding items occurs
gridView.Expanding += (sender, e) => {
System.Console.WriteLine("Expanding!");
};
// callbacks to manipulate the number of items in the TreeGridView
gridView.CellClick += (sender, e) => {
System.Console.WriteLine("Adding!");
var addedParentNode = new TreeGridItem{Values = new object[]{"test_parent" + counter}};
addedParentNode.Children.Add(new TreeGridItem{Values = new object[]{"test_child" + counter}});
counter++;
gridViewItems.Add(addedParentNode);
};
gridView.KeyDown += (sender, e) => {
System.Console.WriteLine("Removing!");
gridViewItems.RemoveAt(gridViewItems.Count - 1);
};
}
}
Specifications
Version: 2.7.1
Platform(s): Gtk3
Operating System(s): NixOS 22.05
Additional Comments
I don't have the ability to test other platforms, so I'm not sure what other platforms this affects.
The text was updated successfully, but these errors were encountered:
Expected Behavior
Expanding the bottom item in a TreeGridView will expand when the expansion arrow is clicked, also running the relevant event.
Actual Behavior
The element is not expanded.
The Expanding event of the TreeGridView is not called.
Steps to Reproduce the Problem
Code that Demonstrates the Problem
Specifications
Additional Comments
I don't have the ability to test other platforms, so I'm not sure what other platforms this affects.
The text was updated successfully, but these errors were encountered: