Eto.WinForms TreeItem with checkbox?

Created on 11 Dec 2016  ·  6Comments  ·  Source: picoe/Eto

I was trying to add a TreeItem with a checkbox to a TreeGrid, but didn't find anything.
How would I get a checkbox next to the treeview-items?
Tom

help wanted

All 6 comments

I would recommend using the TreeGridView instead, which has much more functionality, like the ability to add check boxes.

I am also currently working on a number of things related to the TreeGridView to bring it up to parity with the TreeView (in case this is the reason you are not using it currently) such as refreshing specific items and getting the column/item under the mouse pointer, which should be done within a week or so.

control.Columns.Add(new GridColumn { DataCell = new CheckBoxCell(0), Editable =true }); control.Columns.Add(new GridColumn { DataCell = new TextBoxCell(1) });
Yes, I tried TreeGridView, but it doesn't look nice, because the label is a second column.

On the Mac TreeView and TreeGridView is the same. Looks like, I should in general move to TreeGridView. Please let me know, when you are done with your current work on that.

Yeah on Mac and Gtk the TreeView and TreeGridView use the same native control.

On WinForms and WPF the built-in tree control does not support multiple columns, so it uses the data grid and simulates the tree by managing the node state manually.

As for making the TreeGridView on windows look better with a check box, we might be able to do something like adding a child Cell to the CheckBoxCell for its content, or (probably not doable), but allow each column to have multiple Cells defined.

I noticed several bugs with the TreeGridView on WinForms:

  • unhandled exception, when setting DataStore to null or empty list
  • unhandled exception, when setting DataStore to a new List, which is shorter then the previous one and SelectedItem is higher
  • unhandled exception, when accessing SelectedItems with AllowMultipleSelection = true
  • CheckBoxCellHandler.SetCellValue never called

On Mac this works.
Tom

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Krakean picture Krakean  ·  6Comments

katatunix picture katatunix  ·  12Comments

LaraSQP picture LaraSQP  ·  7Comments

ArsenShnurkov picture ArsenShnurkov  ·  17Comments

rothomp3 picture rothomp3  ·  15Comments