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

Generically typed context in templates

2 Answers 169 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kasimier Buchcik
Top achievements
Rank 1
Veteran
Kasimier Buchcik asked on 25 Jun 2020, 07:50 AM

Hi,

I noticed that the context variable in templates is of type object (e.g. in the drop-down-list, grid-column). 
Is this due to historical reasons? Could this be changed to a generically typed context? 

Regards

Kasimier Buchcik

2 Answers, 1 is accepted

Sort by
0
Kasimier Buchcik
Top achievements
Rank 1
Veteran
answered on 25 Jun 2020, 07:58 AM
My bad, the drop-down-list actually uses a generically typed template.
So do all the components already use generically typed templates (when possible) and the grid-column template is an exception?
While migrating to Blazor I did went through only a fraction of components. Can we expect that all templates will be generically typed in the future?

Regards
Kasimier Buchcik
0
Svetoslav Dimitrov
Telerik team
answered on 25 Jun 2020, 09:57 AM

Hello Kasimier,

Most of our contexts are generic and that will continue in the future. We make it for the convenience of not having to cast it on your own.

That being said, there are some where casting an object to the desired type is needed, for example in the TreeView for better hierarchical support, the Grid's Template and EditorTemplate.

Regards,
Svetoslav Dimitrov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Kasimier Buchcik
Top achievements
Rank 1
Veteran
Answers by
Kasimier Buchcik
Top achievements
Rank 1
Veteran
Svetoslav Dimitrov
Telerik team
Share this question
or