Telerik blogs
  • Web

    Binding a ComboBox to Enum Values with RadControls for Silverlight

    A common request in our support is to display a combo box, containing all values of a specific Enum. This is fairly easy with RadComboBox for Silverlight - all you need to do is to fill its ItemsSource collection with the Enum values. The best way to do this is to create a view model for the Enum: using System; using System.Collections; using System.Linq; using System.Reflection; namespace SilverlightApplication1 { public class EnumModel { private Type enumType; public IEnumerable Values { get; private set; } [TypeConverter(typeof(TypeTypeConverter))] ...
    June 12, 2009
  • Web

    Silverlight/WPF RadChart axis improvements.

    Along with the numerous updates that are coming up with the Q2.2009 version of RadChart for WPF/SL, we are going to introduce significant improvements of the way our horizontal axis handles user data. Actually, a bunch of new features will make the horizontal axis much more intelligent and easy to use. First of all, the horizontal axis will be able to properly handle "X" value data! As soon as a DataPoint with meaningful "X" value is received, the horizontal axis will enter "strict" mode and will place it appropriately.      To make this possible we also implemented the following supporting features: Automatic range calculation...
    June 04, 2009
  • Web

    Data-binding menu, context menu and toolbar, a.k.a. a simple text editor for Silverlight

    This demo extends my previous sample, that demonstrated how to add a right click context menu on a TextBox. Here I will show how to create context sensitive main menu and toolbar, in addition to the context menu. The demo will also demonstrate some advanced enhancements that we added to the Silverlight 2 Framework, such as merged dictionaries and container bindings. The application enables/disables the Cut and Copy commands when there is no selection and also disables the Paste command when there is no clipboard content. As in the previous blog post, the clipboard methods work only in IE. Here is how...
  • Web

    Reusing and customizing a single ContextMenu on a TreeView with RadControls for Silverlight

    This is part two of my Attaching a ContextMenu on TreeView blog post. I will show another approach for adding context menu on a treeview, that uses a single menu that is customized for each treeview item. One context menu per treeview should provide much better performance if the treeview is bound to a large data set, since there are much less visual elements that have to be created. I am also using an updated view model, where each item contains a reference to its parent. This will help me to rely entirely on the model for my application logic, which greatly...
    June 01, 2009
  • Desktop WPF

    Enhancing the Localization Support of RadControls for Silverlight and WPF

    With the Q1 2009 SP2 release of RadControls for Silverlight we introduced an enhancement of the LocalizationManager class. Two new properties were added to enrich the localization support in the suite - DefaultCulture and DefaultResourceManager. With the new properties you no longer have to always create an instance of the LocalizationManager. Here is a brief description of the two properties: DefaultCulture A static property of type System.Globalization.CultureInfo. Use this one to change localized values without changing the UI culture of the current thread. DefaultResourceManager A static property of type System.Resources.ResourceManager. Use this one to change localized values using a new resource manager, i.e. a new resource file. Example: The attached...