ColumnSpan in TreeListView

Grids for WPF Forum

Posted 2 years ago by Dan Hutt
Version: 19.1.1

Hello and happy Thursday!

I'm working on utilitizing the TreeListView for my application and I may have run into a bit of a snag. I have a pretty normal tree structure with three columns where the leaf nodes in the tree have multiple controls inside of them. However, the alignment of these leaf node controls can not fall within one column, but instead I wish for them to span all three columns.

Is it possible to have the leaf nodes ignore the fact that columns exist via a mechanism like the Grid control's column span? I currently have the controls in the first column and when a leaf node is shown, the other two columns expand out of the window and that's not acceptable in this situation.

Thanks for any help!

Comments (2)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Dan,

PropertyGrid does this kind of thing with "category" items where they span the entire row while still maintaining indent, whereas "property" items use the columns like normal.  If you download our default styles/templates from your organization account page on our site and open the Grids' Generic.xaml, look in the PropertyGrid Style.  It sets a PropertyGridItemStyleSelector instance to the PropertyGrid.ItemContainerStyleSelector property.  The PropertyGridItemStyleSelector class picks a Style to use for the "container" (PropertyGridItem for that control but would be a TreeListViewItem for your scenario).

The two Styles to examine in that Generic.xaml for the containers are keyed PropertyGridCategoryItemContainerStyle and PropertyGridPropertyItemContainerStyle.  The former shows the concept of what you'd want to do.  Whereas the latter uses a PropertyGridItemRowPanel in its template to adhere to the columns.

I hope that helps!

Actipro Software Support

Posted 2 years ago by Dan Hutt

Absolutely incredible. Thanks! I got it working just before the end of the day. I appreciate your quick response.

Have a happy weekend!

The latest build of this product (v24.1.2) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.