Add your own properties to Telerik Components

1 Answer 59 Views
General Discussions
Bohdan
Top achievements
Rank 1
Bohdan asked on 17 Dec 2024, 10:58 AM

Hi, 

I couldn't find any articles about customizing Telerik components with additional properties,
but want to add my own property directly to a Telerik component, like this:
<TelerikWindow MyOwnProperty="SomeValue" />

I would like to avoid creating a custom wrapper component where I would use the Telerik component inside.
Is there any way to achieve this directly with Telerik components without having to wrap them?

Huge thanks for your response,
Bohdan

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Tsvetomir
Telerik team
answered on 18 Dec 2024, 12:36 PM

Hello Bohdan,

Adding arbitrary HTML to the rendering of a Telerik Blazor component can yield unexpected results, e.g. the component might require certain elements to be at a specific position with a specific HTML. Adding other elements outside of the standard template parameters that are exposed can break the expected functionality of the component, so this is not something that we recommend. With that being said, I can inform you that we don't support such attributes declaratively.

If this requirement is a must in your project, the alternative is to add a custom attribute with JSInterop. Just keep in mind the above-mentioned concerns.

I hope you find well the provided information.

    Regards,
    Tsvetomir
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

    Tags
    General Discussions
    Asked by
    Bohdan
    Top achievements
    Rank 1
    Answers by
    Tsvetomir
    Telerik team
    Share this question
    or