Telerik blogs
  • Web

    Self-reference hierarchy with Telerik TreeView for Silverlight

    Often we need to display in a TreeView flat, self-referencing data, loaded from a database, that has properties ID and ParentID (or similar) that define the hierarchy. The Telerik TreeView for ASP.NET can automatically bind itself to such data, but our Silverlight TreeView cannot do this out of the box. Fortunately, this “limitation” can be easily avoided with a simple value converter. There is a little trick, however – each data item needs a reference to its parent collection. Consider the following very simple data object: public class DataItem : INotifyPropertyChanged { private string text;   public int ID { get; set; } public int ParentID {...
    August 27, 2009
  • Web

    Mark working hours and days in different colors with RadScheduler for Silverlight

    We received a couple of questions on how some of the days and hours in the different views of RadScheduler can be customized. The answer of this question is in the attached application illustrating how working hours and days can be  marked in orange.  The solution includes 3 easy steps : Create a custom theme using the default RadScheduler' theme. Create a ValueConverter returning the right color depending on the hour/day. Find the style applied to every hour(timeslot) and apply the converter to the Background property. To create a custom theme you can follow the steps...
  • Desktop WPF

    WPF / Silverlight: RadChart with ChartLegend as a ToolTip

    Every now and then we receive requests / inquiries which wordings may vary, but basically all come down to the same thing – my chart space is limited, how to optimize the content of the ChartArea so my data does not look so squashed? One possible solution that works in some scenarios is to hide the legend altogether. Today we will propose another option for those of you who are looking for a less “radical” remedy – display the ChartLegend as a ToolTip on demand. Actually, this is quite easy to achieve with the ToolTipService class provided by WPF /...
    August 20, 2009
  • Web

    Customizing the header of RadPane control and adding behavior to it.

    It is often necessary to customize the header of a RadPane. Really common is to need to put an image in the header, to bind that image to a property, etc. There are many scenarios in which you need to add some custom behavior to the header. One of this situations is when you need to have close button or another button in the header of the pane. The tricky thing here is that you need to implement an event handler for the Click event of the button and to write some code that will do something with the Pane. In...
  • Web

    Drag and drop items onto RadScheduler for Silverlight

    We all are aware that users tend to look for the easiest and most rational way to do something. That is why developers always strive to create their products' interface as intuitive as possible. Speaking in this context, dragging and dropping helps us improve user experience significantly and make end users happier. In this blog post I will explain how we can use RadDragAndDrop to enable users drag items from a certain control and drop them over RadScheduler, while notifying about that. Of course, the described scenario could be extended to act in many different scenarios. Let us say we will drag items from a listbox to...