Comments (2)
The second time you set a DataStore it doesn't trigger OnExpanded anymore:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Eto;
using Eto.Forms;
using Eto.Drawing;
using System.Threading;
namespace etotest
{
class Program
{
[STAThread]
static void Main(string[] args)
{
var generator = Generator.GetGenerator("Eto.Platform.Wpf.Generator, Eto.Platform.Wpf");
var app = new TestApplication(generator);
app.Run(args);
}
}
public class TestApplication : Application
{
public TestApplication(Generator generator)
: base(generator)
{
this.Name = "Test Application";
}
public override void OnInitialized(EventArgs e)
{
this.MainForm = new MainForm();
HandleEvent(Application.TerminatingEvent);
base.OnInitialized(e);
// show the main form
this.MainForm.Show();
}
}
public class MainForm : Form
{
int[] arr = new int[] { 5, 5 };
TreeGridView tv;
void CreateItem(TreeGridItem aParent, string aBaseName, int aLevel)
{
var lName = "[" + aLevel + "]" + aBaseName;
var lItem = new TreeGridItem(lName);
aParent.Children.Add(lItem);
if (aLevel < arr.Length)
for (int i = 0; i < arr[aLevel]; i++)
CreateItem(lItem, aBaseName + i.ToString(), aLevel + 1);
}
void CreateTree()
{
TreeGridItem lRoot = new TreeGridItem();
CreateItem(lRoot, "Name", 0);
Application.Instance.Invoke(delegate
{
tv.DataStore = lRoot;
tv.Expanding += Expanding;
});
}
public MainForm()
{
Size = new Size(900, 800);
var lp = new Panel();
this.AddDockedControl(lp, new Padding(5));
var lPanelLayout = new TableLayout(lp, 1, 2);
lPanelLayout.Padding = new Padding(0);
var lButton = new Button();
lButton.Text = "Rebuild";
lButton.Click += but_Click;
lPanelLayout.Add(lButton, 0, 0);
tv = new TreeGridView();
tv.Columns.Add(new GridColumn { DataCell = new TextBoxCell(0) });
lPanelLayout.Add(tv, 0, 1, true, true);
}
void but_Click(object sender, EventArgs e)
{
CreateTree();
}
void Expanding(object o, EventArgs e)
{
MessageBox.Show("Expanding");
}
}
}
from eto.
Fixed with commit 62b60fb
Thanks again for the repro!
from eto.
Related Issues (20)
- Support .NET Framework HOT 1
- Keyboard Input under Wayland
- MacOs : Cannot trigger an action when Enter is pressed HOT 2
- Sharing an executable version of Eto.Test HOT 2
- Remove XamMac2 platform
- Keys.Plus is obsolete although it is a separate key on german keyboards HOT 2
- [develop] .ToEto().ToNative() should return the original control HOT 2
- Form (Preview) does not work with F#
- [BUG] DocumentPage content loses focus if property changed
- BinaryFormatter is insecure and strongly cautioned against HOT 5
- [WPF on Win7] Dialogs appear with negative location HOT 2
- TextArea text is not visible when using Wrap on macOS 14 HOT 3
- C# template doesn't compile HOT 4
- [macOS] Error loading macOS .NET 6 workload project in Rider HOT 2
- [WPF] Pressing Enter in GridView moves the selection to the next line HOT 2
- Native Filepickers silently fail/don't appear when CurrentFilter is set
- Programmatically closing a dialog
- [WPF] PropertyGrid Crash with Dictionary
- Visual Studio Preview Plugin fails to render dependent forms
- Weird behavior with key events for some keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eto.