This is a migrated thread and some comments may be shown as answers.

CanUserSelectColumns

2 Answers 40 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Yaroslav
Top achievements
Rank 1
Yaroslav asked on 30 Jul 2019, 05:11 AM

Hi guys,

In our application we are using RadTreeListView and need to give users an ability to choose displayed columns (except the tree column).

Given all the similiarities between RadTreeListView and RadGridView I expected to use property CanUserSelectColumns (like described here https://docs.telerik.com/devtools/wpf/controls/radgridview/selection/column-selection) but surprisingly such a property does not exist for RadTreeListView. 

So could you please advise what would be the best possible solution given that we want it to be the same way as for gridviews in other parts of the application? Thank you.


2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 01 Aug 2019, 04:20 PM
Hello Yaroslav,

Thank you for the provided link.

Currently, the RadTreeListView does not support column selection and that is why it does not have the CanUserSelectColumns property. I am assuming that there were some difficulties with the hierarchy structure and that is why the feature was only implemented for the RadGridView.

That said, if you only want to enable the column selection for non-hierarchy columns, I can suggest utilizing some methods residing in GridViewDataControl. I am attaching a sample project demonstrating what I have in mind.

Note, that the approach uses an internal property of GridViewDataControl, which it accesses using reflection. The methods of that class are exposed by the RadGridView, however the RadTreeListView does not expose them, since it does not support column selection. Additionally, note that the demonstrated approach is a customization and I have not tested it extensively on my end.

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Yaroslav
Top achievements
Rank 1
answered on 05 Aug 2019, 11:33 PM

Hi Vladimir,

Yes that's very helpful, thank you for your answer and the example.

Yaroslav

Tags
TreeListView
Asked by
Yaroslav
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Yaroslav
Top achievements
Rank 1
Share this question
or