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

Common Functionality For All My RadGrids

3 Answers 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeremy Yoder
Top achievements
Rank 1
Jeremy Yoder asked on 21 May 2010, 08:25 PM

I want shared functionality for all RadGrids in my project, but I can't figure out how. I started with a WebUserControl (ascx) but learned it requires the same markup for all instances, which I can't as I need different columns in different pages, along with other property settings.

Is there a way to create a control that wraps/inherits a RadGrid that allows me to create shared methods, events, and properties, but have different markup on different pages? Or is that not possible and I need to copy-paste my server-side code to all instances and pages? Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 May 2010, 09:46 AM
Hi Jeremy,

There are a couple of techniques that you can implement to reuse RadGrid configuration settings:

+ yes, you can inherit the RadGrid control and define some members (properties or event handlers) at a single location.

+ you can also use ASP.NET themes

Of course, the code and settings, which are related to column configuration and all other things, that will be different across the different control instances (probably including data binding as well), cannot be reused from a single place.

Sincerely yours,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jeremy Yoder
Top achievements
Rank 1
answered on 24 May 2010, 02:22 PM

While I know how to do this in VB.NET, I don't know how in ASP.NET. Do you have a dummy app to show how it can be done with the RadGrid control?
0
Dimo
Telerik team
answered on 25 May 2010, 02:36 PM
Hello Jeremy,

You can use the VB language to inherit the RadGrid control and implement all additional configuration. The programming pronciples in ASP.NET when working with web controls are the same as the one you are already familiar with.

Here is some more information about ASP.NET themes:

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/themes/default.aspx

Greetings,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Jeremy Yoder
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jeremy Yoder
Top achievements
Rank 1
Share this question
or