Efficient Grid Usage: Centralization of Recurring Functions

1 Answer 22 Views
Grid
Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
Hendrik asked on 20 Mar 2025, 05:13 PM
I use the grid in many places, and I would like not to have to reimplement recurring tasks, such as state management or Excel export, every time. I have thought about using a custom wrapper, but that is very laborious and complicated. Is there an elegant way to centralize some functions?

1 Answer, 1 is accepted

Sort by
0
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
answered on 20 Mar 2025, 08:46 PM | edited on 20 Mar 2025, 08:47 PM
Hi Hendrik,

You can reuse code by either inheriting from or wrapping Telerik components. There is a basic article that provides some information on this topic: https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-extend-inherit-wrap-reuse-telerik-blazor-components.

I believe that wrapping the components is a better approach. Blazor provides several features that can help with this, including:


Regards,
Anislav Atanasov
Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 21 Mar 2025, 07:09 AM

Thank you very much for your support. I discovered a way to integrate the grid into a wrapper while retaining all its features—such as aggregates, details, and so on—without duplicating any functionality within the wrapper. 
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
commented on 21 Mar 2025, 08:54 AM

If you're open to it, feel free to share some of the code. I'd be happy to review it and provide feedback—it could also help others looking for a similar approach!

Regards,
Anislav Atanasov
Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 21 Mar 2025, 09:52 AM

Yes, I am open to it but I have to build an extra sample. Can not use my actual code. But my solution should be helpful to other users. I am always thinking of a kind of "Community Toolkit" where to find samples and best-practices. The samples from Telerik are often outdated and hard to  get running... Why is nobody updating those samples !?

 

Dimo
Telerik team
commented on 25 Mar 2025, 07:47 AM

@Hendrik - Can you please specify which outdated samples are you referring to? If you are talking about the ones in the blazor-ui repo, indeed, some of them are quite old. We have an ongoing effort to:

Let me know if you have stumbled upon anything specific that you feel should be updated. All examples in the documentation should be up-to-date, unless they target an old product version by design.

Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 25 Mar 2025, 07:54 AM

Yes, I mean the samples in the repo. The samples in the online documentation and samples are good, but some tricks are only covered in the repo. Btw: I am always stumbeling over TelerikMessages.resx that supposed to take from the repo. But it is also outdated and I get errors when newer components have new descriptions...
Dimo
Telerik team
commented on 25 Mar 2025, 08:00 AM

The location of up-to-date localization .resx files is documented at Localization - Add Resource Files
Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 25 Mar 2025, 08:42 AM

Thank you for that hint. I took it always from the demo-repo. Maybe I misunderstood something...
Tags
Grid
Asked by
Hendrik
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Anislav
Top achievements
Rank 6
Silver
Bronze
Iron
Share this question
or