Telerik blogs
  • Web

    Attaching a ContextMenu on a TreeView with RadControls for Silverlight

    Telerik RadControls for Silverlight provide a very powerful ContextMenu control, that supports right click, modifier keys and that can be easily attached to any visual element. In this article I will show how to attach RadContextMenu to a data-bound RadTreeView and perform actions on the clicked treeview items, depending on the selection in the context menu. For simplicity, here I will use a treeview, bound to a static collection, but it can be easily extended to load its items from a web service: <UserControl x:Class="ContextMenuInTreeView.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ContextMenuInTreeView" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"> <UserControl.Resources> <local:DataViewModel x:Key="ViewModel" /> <telerik:HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Text}"> <telerikNavigation:RadContextMenu.ContextMenu> <telerikNavigation:RadContextMenu> <telerikNavigation:RadMenuItem Header="New Child" /> <telerikNavigation:RadMenuItem Header="New Sibling" /> <telerikNavigation:RadMenuItem Header="Delete" /> </telerikNavigation:RadContextMenu> </telerikNavigation:RadContextMenu.ContextMenu> </TextBlock> </telerik:HierarchicalDataTemplate> </UserControl.Resources> <StackPanel Background="White" DataContext="{StaticResource...
    April 27, 2009
  • People

    Being new to Silverlight

    Keeping track of new technology is quite a tedious job.  In fact, if you try to catch up with all hot trends in software development you probably will end up having a job as a full time blog reader. In contrast, most software developers are always anxious about stretching their fingers on some actual coding. But the beginning is always the hardest part, even more if you are not patient enough or haven’t had time to watch videos and spent hours reading tutorials. In case you are coming from a different programming background, you are certainly used to specific methods...
    April 17, 2009
  • Web

    Silverlight: RadChart interoperability with ASP.NET

    Now that the RadChart control has officially joined the Silverlight party you are probably considering how to incorporate this jewel in all of your web projects. Probably most of you do not have the luxury to start over from scratch and implement pure Silverlight solutions abandoning all of your ASP.NET knowledge and legacy. With this blog post I will try to provide a simple demonstration how you can take advantage of the RadChart for Silverlight and easily add it to your current ASP.NET web applications. You'll also see how you can update some of the chart properties directly from your ASP.NET...
    March 17, 2009
  • Web

    Working with WCF Web Services in Silverlight, a headache/solution approach

    So if you’re like me, you’re on board with Silverlight and looking to get the most out of your RIA development.  I’ve taken all the advice offered for creating Silverlight apps with WCF services- this video by Tim Heuer has been indispensable, but now we can create a Silverlight Enabled WCF service to avoid the modifications in web.config. When working on an application recently, I was somewhat confused by the error I received after deploying to my local friendly IIS server on the network: HTTP/1.1 500 Internal Server Error Date: Wed, 11 Mar 2009 20:37:29 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/xml; charset=utf-8 Content-Length: 734   Content-Length:...
    March 12, 2009
  • Web

    Comparing Generic Types

        Today I was dealing with the problem of comparing generic types in Silverlight. After researching the problem I found many similar issues for which I couldn't find any straightforward solution on the web. So here we go - a post on the issue how to compare generic types. First, let’s say we have a simple generic class which is composed of two generic properties A and B, and a method that we will later use to compare these two properties. Moreover, I will constraint the class to invoke the constructor of the generic type argument by using where T : new()      public class GenericClass<T> where T : new()       {...
    January 10, 2009