Telerik blogs
  • Web ASP.NET AJAX

    Gracefully degrade RadChart for Silverlight in ASP.NET

    In a recent webinar, I showed an example of how you can build a superior user experience in an ASP.NET website by using RadChart for Silverlight. The Telerik Silverlight chart has animations, rich rendering, and is much more visual appealing than the “static” RadChart for ASP.NET. But while the Silverlight chart is a great way to enhance data visualizations in your ASP.NET site, how do you handle users that don’t have Silverlight installed? One approach is to implement “graceful degradation.” Graceful degradation is an important and familiar principle in web design, and essentially it means this: if you build features into...
    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...
  • Web

    Applying Themes on RadControls for Silverlight

    The theme engine of RadControls for Silverlight is quite powerful and provides the developers with the ability to apply application-wide theme on all RadControls, as well as specific theme on a single control. If the theme does not contain the needed styles, the controls fallback to their default styles, so you could create an application theme for just a couple of controls and the rest will display with their default styles. We also provide styles for the standard controls, such as Button, CheckBox, RadioButton, etc. which enables you to create application with consistent look and feel. Each theme is distributed as...
    May 18, 2009
  • Web

    GridView in ComboBox with RadControls for Silverlight

    Recently we received several requests for an example, demonstrating how to put a virtualized GridView in a ComboBox popup. The best way to do this in my opinion is to replace the ItemsPresenter of the ComboBox with a GridView. There is some plumbing that has to be done, but I managed to separate it in two attached behaviors. The original idea is described in my blog post for TreeView in ComboBox which I recently updated with the latest control template of RadComboBox for Silverlight. The principle is exactly the same with RadGridView and it should work with very minor adjustments with...
    May 18, 2009