picoe / Eto

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

Eto.WinForms TreeItem with checkbox? #630

Open TomQv opened 7 years ago

TomQv commented 7 years ago

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

cwensley commented 7 years ago

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.

TomQv commented 7 years ago

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.

TomQv commented 7 years ago

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.

cwensley commented 7 years ago

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.

cwensley commented 7 years ago

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.

TomQv commented 7 years ago

I noticed several bugs with the TreeGridView on WinForms:

On Mac this works. Tom