Telerik blogs
  • Productivity

    LINQ: Sequence contains no elements. Extension methods to the rescue.

    When you start playing with LINQ queries over sequences of elements (e.g. getting min / max value for enumerable source) sooner or later you will come across this one -- the InvalidOperationException (“Sequence contains no elements”). The problem occurs as by default queries like IEnumerable<T>.Min(…) and IEnumerable<T>.Max(…) do not play nicely if you try to execute them on an empty sequence and just throw the exception described above. Unfortunately these methods do not have a corresponding counterpart like Single(…) / SingleOrDefault(…) that is smart enough to query the sequence if it is not empty or alternatively use the default value without raising...
    May 27, 2021 2 min read
  • Release

    Telerik.Charting in RadControls for ASP.NET AJAX Q3 2008

    There is no Telerik.Charting.dll anymore. It is now merged into Telerik.Web.UI. You will no more have to worry about its version and its registration in Web.config or replacing it in GAC when new version is out. Here are the steps you need to take when upgrading your applications from RadControls for ASP.NET AJAX version prior to Q3 2008 to RadControls for ASP.NET AJAX Q3 2008 and later: · If you have Telerik.Charting installed in GAC (this used to be the default RadControls installer action) replace the following Register directive <% Register Assembly="Telerik.Charting, Version=2.0.5.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" Namespace="Telerik.Charting" TagPrefix="telerik" %>   with this one: <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %> You will also need to remove...
    May 27, 2021 2 min read
  • Desktop WPF

    WPF: Debugging Expression Blend Exceptions with Visual Studio

     Although Expression Blend and Visual Studio can work on the same solution / project files, they remain two separate IDEs and it is not uncommon for certain functionality to work correctly in the Visual Studio design-time environment and throw an error in the Expression Blend one. The Blend error output does not always help much with identifying the reason for the erroneous behavior:    This clearly does not give us enough information to track the problem down. Fortunately there is an easier way to detect the problem instead of wandering around the code in a manual “debugging” session – the Visual Studio...
    May 27, 2021 1 min read
  • Web

    RadControls for Silverlight 2 - Drag and Drop Basics

    Who would not like to implement a sleek drag and drop in minutes? I definitely would. This is why I find the new RadDragAndDrop a welcome addition to the controls. Straight to the point then: How to implement a simple drag/drop? To answer this question I will walk you through the DragDrop example that is available here: http://demos.telerik.com/silverlight/#Examples/DragAndDrop/FirstLook This example shows that the DragDrop can be used with any controls/objects, not just the Telerik RadControls. DragDrop 101 Few simple things to remember: Every object that will be dragged must have AllowDrag property to true, it is an attached property and in xaml it can be set the following way:   <Rectangle...
    May 27, 2021 7 min read
  • Desktop WPF

    Storing User Docking preferences

        Many times in an application you want your user to have the ability to set preferences.  This extends to a variety of settings, but what about the interface itself?  If you are using the DockingManager you can give the user the ability to modify the layout of existing DockPanels and store it for them.  Why would you want to let the user change the layout?  Every person is different and most people enjoy having the option of customizing an application.  This can be as simple as having a tool window on the right of the screen instead of the...
    May 27, 2021 2 min read