Duplicated
Last Updated: 02 Apr 2025 08:11 by ADMIN
Benjamin
Created on: 25 Mar 2025 08:00
Category: TreeListView
Type: Feature Request
0
TreeListView: The formatting is not applied to the second level when the grid is bound to two types of items
The formatting is not applied to the second level when the grid is bound to two types of items.
Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
5 comments
ADMIN
Martin Ivanov
Posted on: 02 Apr 2025 08:11

Hello guys,

@Martin, thanks for sharing your solution.

Can you tell me what other reports related to this you found or at least point me where you found them, so I can try searching on myself? I mean in the forum, or here in the feedback portal, or somewhere else? I am asking this, so I can go through the other posts and see if I can address them in a meaningful manner.

About the issue at hand, in general the RadTreeListView was designed to work with the same data type on all levels, which leads to limitations here and there. That includes the scenario with class inheritance. This design decision was taken to make the control easier to maintain, more performant and less prompt to errors. For this specific scenario, we actually logged it recently in a separate item, which is why this was marked as duplicated. You can follow the other item for updates and an alternative workaround.

@Benjamin, it is sad to hear that you are not satisfied with the development of this case and the missing solution. In any case, we appreciate the feedback and it is good that you found a proper solution, thanks to Martin. In case you come up with extra feedback, don't hesitate to share it.

Regards,
Martin Ivanov
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Benjamin
Posted on: 01 Apr 2025 15:53
@Martin : it works like a charm, you are my hero. I want to pay you a beer !

@Telerik : I'm disapointed about your support, it used to be way better than this...
Martin
Posted on: 01 Apr 2025 15:49
Sorry was kinda bitter, ater only finding the same "bug" reported multiple times some marked as feature reuqest and no real solution from the people we pay :-). Took me whole frustrating day of debuging compiled telerik libraries to understand what is happening so i can "fix" it, hope it works for you.
Benjamin
Posted on: 01 Apr 2025 15:41

@Martin : Thank you so much for doing the job you are not paid for...

Martin
Posted on: 01 Apr 2025 14:01

Workaround: register to DataLoaded event in your RadTreeListView and inside the codebehind method do something like this:

((QueryableCollectionView)((RadTreeListView).Items.SourceCollection)).ItemType = typeof(yourbasetype - probably generic type of you bound collection)

(yes its ugly, you can make it nicer and generic and into a behaviour, but im not paid for writing this)

Formating does not work because if the "top" collection contains only one type, then column thinks (well its more complicated, but it douesnt matter) its only for this type and fails to return formated string for second level which has different type - it returns value but does not aply the stringformat.

By settings the type, the column will be happy that the dataitem is of type derived from collectionview item type and will return value with sting applied.

At least this works for me and my problem.

 

PS: Taging this as feature request is just plain wrong, beacuse its obvious bug.