Friday, January 12, 2007

r.a.d.control tips: global skin and single assembly

Even if you've worked with the r.a.d.controls for years, there are always little tips and tricks waiting to be discovered. This week I ran into a couple of tips that you may find useful in your own projects:

  1. Global Skin: Have you ever wanted to set the Skin for all of the r.a.d.controls in your application globally? It may be easier than you think. If you add the following code your Web.Config file, you can easily pick a Skin that applies to all of your controls: <configuration>     <appsettings>        <add value="Office2007" key="Telerik.WebControls.Skin">     </appsettings> </configuration> Your r.a.d.controls will automatically detect this AppSetting and apply the correct Skin (unless you've explicitly defined the Skin property on a control instance). Just remember to use a Skin that has styles for all of the r.a.d.controls!
  2. Single Assembly: Some of the largest, most "passionate" forum threads I've been involved in on telerik.com have revolved around the issue of the r.a.d.controls multiple assembly model. One side, you have the people that would prefer to deploy one huge assembly that updates all r.a.d.controls at once, and on the other side you have people that prefer discrete assemblies so they can delay upgrading specific controls have more control over applying hotfixes. Both approaches have their merits and both have their "my way or the highway" supporters. Telerik has decided to stick with the multi assembly approach for now because it is the established distribution model, but there is a possible solution for those who want the mega r.a.d.control assembly. Microsoft created a free tool called ILMerge in 2004 that can merge multiple .NET assemblies into a single DLL. Ryan Means mentioned the tool on the telerik.com forums and early feedback from telerik seems to indicate that the tool will work with the r.a.d.controls. Telerik's work with this tool may indicate that a merged assembly could be included in future r.a.d.control releases. If you're dying to reduce your assembly count, download ILMerge and satiate your need for simplicity today.

3 comments:

Paul Qualls said...

Telerik.WebControls.Skin didn't work for me with the Q2 2008 controls. I changed it to Telerik.Skin and it worked.

Todd Anglin said...

@Paul- Thanks for dusting off an old post! Indeed, the name has changed in the new ASP.NET AJAX controls to "Telerik.Skin." You can find complete guidance in the docs on this page:
http://www.telerik.com/help/aspnet-ajax/skinregistration.html

-Todd

Unknown said...

Todd, let me dust off this post once more...

when "ILMerging" all Telerik WPF DLL's I get an error: ILMerge.Merge: ERROR!!: Duplicate type 'XamlGeneratedNamespace.GeneratedInternalTypeHelper' found in assembly 'Telerik.Windows.Controls.Input'.

Marco Zhou has a workaround here: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/1ba71aba-9ab2-4d66-8722-b94eca29d0b4

But I think this (...change the namespace in IL...) is much more than I can currently "handle"...

Is there any other option you can think of to get "one dll" ?

Yours, Nils