Custom colored text in TreeView and GridView

137 views
Skip to first unread message

Josef Nemec

unread,
Sep 3, 2015, 1:51:28 AM9/3/15
to Eto.Forms
I need to have TreeView and GridView with text that can be colored with multiple colors. In practice I need to color some specific words, it should look like this:









How would I do that in Eto? I know there's DrawableCell for GridView, but I don't see anything like that for TreeView.

curtis

unread,
Sep 4, 2015, 12:10:54 PM9/4/15
to Eto.Forms
Hi Josef,

I'd suggest to use the TreeGridView, which supports using DrawableCell (and multiple columns).

Hope this helps!
Curtis.

Josef Nemec

unread,
Sep 10, 2015, 8:29:28 AM9/10/15
to Eto.Forms
Thanks, TreeGridView seems to work ok. However I'm currently struggling with DrawableCell. I don't known how to make sure that it resizes GridColumn based on how long the text is. I can measure text size via MeasureString method, but I don't know how to update Column width from Paint event handler.

msa...@gmail.com

unread,
Apr 12, 2017, 12:53:10 PM4/12/17
to Eto.Forms
I have a similar need and following Curtis advise I can now successfully use TreeGridView and DrawableCell, 
Unfortunately I have not managed so far to make a DrawableCell work if it is the first one in the Columns list: it is always rendered all white. 
Any clue why?

msa...@gmail.com

unread,
Apr 18, 2017, 3:30:57 PM4/18/17
to Eto.Forms
Little update at my last comment: DrawableCell as a first column works fine on Mac but is always rendered all white on Windows using Wpf

curtis

unread,
Apr 18, 2017, 3:46:23 PM4/18/17
to Eto.Forms
Hi Massimiliano,

This sounds like a bug.  You should enter an issue on https://github.com/picoe/Eto/issues and someone can take a look.

Cheers!
Curtis.
Reply all
Reply to author
Forward
0 new messages