Question

I'm using this thread solution in my WinForms project.
Parent rows have 4 colums, child rows have another 2 different columns.

How can I change width of the lines that are drew after row expand?
I want this lines to be draw as wide as width of the parent columns...

or maybe there is another way to populate this TreeListView? Any suggestions?

Was it helpful?

Solution

You want the horizontal line to be drawn over several columns, so that there is no "gap" right? There is probably no easy way to achieve this.
The TreeRenderer that is assigned to treeListView.TreeColumnRenderer handles the respective drawing. It might be possible to sub-class the TreeRenderer and implement the required changes to the drawing functions.

Maybe it is easier for you to re-think your tree layout. Maybe you should put the information of the parents into one column (you can use the AspectGetter instead of AspectName to create customized content for the column) and put the data from the first child column also in the primary column. Then you have no gap behind the line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top