Hello,
I have a custom razor component called MyGrid.razor which encapsulates the TelerikGrid component.
The goal of my doing is to achieve a result which looks like the following:
<MyGrid>
<MyGridColumn Title="Id" Width="200px" Field=@(nameof(MyDTO.Id))>
@{
@(MarkupString)MyService.FormatTitle(context.Title)
}
<MyGridColumn>
<MyGridColumn Title="Status" Width="200px" Field=@(nameof(MyDTO.Status))>
@{
@(MarkupString)MyService.FormatStatus(context.Status)
}
<MyGridColumn>
</MyGrid>
<MyGridColumn Title="Id" Width="200px" Field=@(nameof(MyDTO.Id))>
@{
@(MarkupString)MyService.FormatTitle(context.Title)
}
<MyGridColumn>
<MyGridColumn Title="Status" Width="200px" Field=@(nameof(MyDTO.Status))>
@{
@(MarkupString)MyService.FormatStatus(context.Status)
}
<MyGridColumn>
</MyGrid>
The component MyGridColumn should represent the GridColumn which is a Telerik component. So ultimately my goal is to encapsulate the TelerikGrid and also its components like the GridColums, GridColumn, so I do not have to copy-paste the same component with its settings from one razor page to another.
Is there any way I could achieve this without the need of using the RowTemplate and is this actually even possible?
Best regards,
Nikita