• .NET

    Complex filtering for RadChart

    RadChart allows you to programmatically filter its data using FilterDescriptors as demonstrated in our help topic. However there are scenarios where you would like to have more complex filtering. For a sample scenario where a Chart is drawn according to the filtered RadGridView’s data - read further. The Chart and the GridView will be populated with the same data source – List of Business Objects: public class MyDateObject   {       public double SampleValue { get; set; }       public DateTime Date { get; set; }   }     public class MyDataContext   {       public const int min = 20;       public const int max = 80;       public ObservableCollection<MyDateObject> List { get; set; }       Random r = new Random();       DateTime baseDate = DateTime.Today;         public MyDataContext()       {           this.CreateChartData();       }         private void CreateChartData()       {           List = new ObservableCollection<MyDateObject>();           for (int i = 0; i < 15; i++)           {               List.Add(new MyDateObject() { SampleValue = r.Next(min,...
  • .NET

    Just Another Way to Visualize Your Data Using RadTreeView for Silverlight

    For the past couple of days I've been playing with the way RadTreeView renders its items. To be honest, I wasn't looking for any particular outcome. I was doing it just for fun, hoping that something interesting might come out. And it did. I ended up with something quite interesting and it would be a shame not to share it. Bellow are few screenshots which show the TreeView from its initial state to the point where its deepest item is expanded. Note: I do lack certain designer skills :) The TreeView is bound to an XML data source which has the following...
  • .NET

    Integrating Silverlight Data Visualization controls with WCF RIA Services

    Hello everyone! There are several blogposts which demonstrate how to bind RadControls to an SQL database using WCF RIA services. This one will show how the Data Visualization controls can be bound to а sample database with RIA services. For this sample a combination of RadTimeBar and RadLinearSparkline is used without code behind modifications or ViewModel. Changing the selection of TimeBar’s time span updates the “Flight Statistics” and “Arrivals and Departures statistics” charts. The Bar Chart is populated with the number of Arrivals per Date (as being selected) and the Pie shows the Total of the Arrivals/Departures for the chosen...
  • .NET

    Reading/Writing cookies with HtmlPlaceholder for Silverlight

    Recently we received a support ticket with a question whether RadHtmlPlaceholder provides support for cookies. By default, RadHtmlPlaceholder doesn't have a mechanism for reading/writing cookies. However, with the right bits of JavaScript, everything is possible :) Imagine you have an HTML page which you want to read/write cookies to and all this has to happen from Silverlight. First, you need few JavaScript methods for reading/writing cookies. Let's call the page we want to read/write cookies to CookiesPage.html. <html>     <head>         <title>Cookies Page</title>         <script type="text/javascript">             // Create a cookie with the specified name and value             function SetCookie(name, value) {                 document.cookie = name + "=" + value;                 alert("Cookie successfully set");             }             // Retrieve the value of...
  • .NET

    Performance Improvements in RadSlider

    As Miro mentioned in his last post, with the upcoming 2011 Q1 Beta, we will release a new and improved version of RadSlider. A lot new features are being added and many of the existing hot spots were addressed along the way. One of them - the performance hit when RadSlider has to re-render its ticks. I took the liberty to compare the impact of RadSlider on an application before and after we made the improvements. Scenario: Every second, for 60 seconds, generate a new ViewModel and set it as DataContext to RadSlider. Goal: See how many times the LayoutUpdated event will...