picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.57k stars 325 forks source link

Invalidating a TreeGridView fails to update it on Mac but works on WPF and GTK #2473

Closed jonko0493 closed 1 year ago

jonko0493 commented 1 year ago

Expected Behavior

After modifying the text of an item in a TreeGridView, calling Invalidate() will redraw the control so the new text will be visible.

Actual Behavior

This happens on WPF and GTK but not on Mac.

Steps to Reproduce the Problem

  1. Clone https://github.com/jonko0493/TreeGridViewMinRepo
  2. Run the application on Windows or Linux.
  3. Select one of the Hellos or Worlds and press F2 (or select Rename from the File menu). Observe that the text of that item changes.
  4. Run the application on macOS.
  5. Select one of the Hellos or Worlds and press F2 (or select Rename from the File menu). Observe that the text does not change.
  6. Collapse and then re-expand the category of the item you just changed. Observe that the text has now changed.

Code that Demonstrates the Problem

https://github.com/jonko0493/TreeGridViewMinRepo

But the important part is:

treeGridView.SelectedItem.Text = "New Text";
treeGridView.Control.Invalidate();

Specifications

cwensley commented 1 year ago

Hi @jonko0493, thanks for reporting the issue!

While Invalidate() may work on some platforms, you should be using ReloadData() or ReloadItem() instead to tell the TreeGridView which item(s) have changed.

Hope this helps!

jonko0493 commented 1 year ago

That seems to work perfectly! Thanks so much for the help!