DataList template as standalone Razor component

In all the DataList examples, the template is defined within the DataList. Is it possible to have the template as an standalone Razor component? If so, how do I integrate the template Razor component and the DataList?

Thanks!

Yes, this is possible. Create a component as usual and set its properties from the template context:

<Template Context="order">
   <MyCustomComponent Text=@order.OrderName Date=@order.OrderDate />
</Template>
1 Like

Thank you very much!!!!