Telerik blogs
  • Desktop WPF

    Controlling TreeView’s ExpanderStyle Dynamically

    Sometimes the TreeView is used in scenarios where the expander style must be styled in custom fashion. Prior 2010 Q3 SP1 there was no easy way to dynamically change the expander style of the TreeView or particular item. TreeView’s ExpanderStyle So we decided to extend the functionality provided by the TreeView. Prior this enhancement changes to the ExpanderStyle property during runtime would not affect already visible items. The property now supports dynamic values and data binding. This way you can easily change the style of the expander of all items in the hierarchy during runtime. Item’s ExpanderStyle Working only with the TreeView’s ExpanderStyle...
    January 17, 2011
  • Web

    TreeView BringIntoView

    Quite often TreeView is used in scenarios where a particular item should be displayed on the screen. You may want to display some item when the tree is initially shown on the screen or when a new item is added. These scenarios look simple but are a bit tricky because you have to wait until the TreeView loads and then make your desired actions. Waiting for Loaded Event TreeView provides the BringIntoView functionality in several forms: you can call BringIntoView from the tree itself and bring a child item; get some TreeViewItem by calling GetItemByPath and call BringIntoView upon this item container;...
    January 12, 2011
  • Desktop WPF

    How to Implement AutoScroll While Dragging in RadTreeView

    With this short post I’ll explain how to achieve a functionality similar to the one shown bellow. Unable to display content. Adobe Flash is required.   The key to achieving this scenario is to use Behaviors. Start off by adding a reference to the System.Windows.Interactivity.dll which is located in: [WPF] C:\Program Files (x86)\Microsoft SDKs\Expression\Blend 3\Interactivity\Libraries\WPF\ [Silverlight] C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries\ (note: the location of the binary might be different on your machine) Then create a class called AutoScrollBehavior.cs using System; using System.Windows; using System.Windows.Controls; using System.Windows.Interactivity; using Telerik.Windows.Controls; using Telerik.Windows.Controls.DragDrop; #if SILVERLIGHT using EventManager = Telerik.Windows.EventManager; #endif namespace TreeView.AutoScroll { public class AutoScrollBehavior : Behavior<RadTreeView> { protected override void OnAttached() { ...
    November 25, 2010