Telerik blogs
  • Desktop WPF

    How to apply different templates to different appointments of Telerik Scheduler for WPF/Silverlight.

    In the upcoming Q2 release RadScheduler  will include a new property called AppointmentTemplateSelector. This property will be included in both  Silverlight and WPF versions of the control. Using it,  you will be able to easily apply different DataTemplate  to the appointments by any custom condition. All you need to do is to create a custom class inheriting from the  DataTemplateSelector class and override the SelectTemplate method.   For...
  • Web

    How to add a right click context menu on a TextBox in Silverlight?

    How to add a right click context menu on a TextBox in Silverlight and also support simple editing commands, like Cut, Copy and Paste? This is pretty easy with RadContextMenu for Silverlight and I will show you now: First I declared a TextBox and set the RadContextMenu.ContextMenu attached property on it: <TextBox x:Name="TextContainer" AcceptsReturn="True" TextWrapping="Wrap" Text="Right click to open a fully functional context menu that depends on the selection and the clipboard content">    <telerikNavigation:RadContextMenu.ContextMenu>        <telerikNavigation:RadContextMenu ItemClick="ContextMenuClick" Opened="ContextMenuOpened" Closed="ContextMenuClosed">             <telerikNavigation:RadMenuItem Header="Cut" />             <telerikNavigation:RadMenuItem Header="Copy" />             <telerikNavigation:RadMenuItem Header="Paste" />         </telerikNavigation:RadContextMenu>     </telerikNavigation:RadContextMenu.ContextMenu> </TextBox> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   If you want to open the context menu with Right click, you need to make the Silverlight plug-in windowless. Otherwise, you should set the EventName and/or ModifierKey properties on RadContextMenu to configure it...
  • Web

    Fair Winds and Following Seas

    This is Memorial Day weekend in the United States and today represents my last day as a Developer Evangelist for Telerik.  When I joined Telerik, I knew the company mostly from their outstanding reputation as a community supporting organization.  Since joining the company I have seen another side of Telerik that I think people may overlook.  The company slogan is “deliver more than expected” and sure, plenty of companies talk the talk, but very rarely do you see a company put it in action.  I am talking about people who have a real passion to deliver a product that exceeds...
    May 22, 2009
  • Web

    Mouse Right Click, Double Click and Mouse Wheel in RadControls for Silverlight

    Telerik RadControls for Silverlight provide three routed events in addition to the Silverlight mouse events: MouseWheel, MouseDown and MouseUp. The latter two enable the developers to check for DoubleClick and RightClick in their applications. I will briefly show how to use this functionality: 1) MouseWheel: using Telerik.Windows.Input; ... Mouse.AddMouseWheelHandler(element, OnMouseWheel); ... private void OnMouseWheel(object sender, MouseWheelEventArgs args) { var delta = args.Delta; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   In most cases you just need to make a ScrollViewer to respond on the mouse wheel rotations. We implemented this in the ScrollViewerExtensions.EnableMouseWheel attached behavior, so you don't have to: xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" <ScrollViewer telerik:ScrollViewerExtensions.EnableMouseWheel="true"> ... </ScrollViewer> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } NOTE: To successfully handle the mouse wheel events, the Silverlight plugin should be in windowless mode.   2) RightClick using Telerik.Windows.Input; ... Mouse.AddMouseUpHandler(element, OnMouseUp); ... private void OnMouseUp(object sender,...
    May 21, 2009
  • Web

    Saving some lines of code when using RadWindow

    If you are using some of the predefined modal dialogs part of RadWindow: Alert, Prompt and Confirm you may find this article quite handy. As you know the calls to these methods are asynchronous, thus you cannot stop the current UI thread in order to get the user feedback from the windows synchronously. This introduces some issues such as the need to declare class member variables whenever they may not be necessary. Due to that there have been a few requests on our support website to create a generic parameter inside the static calls of the dialogs with the purpose of carrying...