Telerik blogs
  • Web

    Calculated column in RadGridView for Silverlight + math expressions

    When the data layer does not allow to perform calculations we often need to harness the UI. Here is a a simple case  - in our business object we have the Price and the Count properties. We will have RadGridView to calculate the Total  for us in a calculated column.   Please download this sample project   If you peek into the sample project you will notice we are using a pretty standard Silverlight approach : We bind the value of the calculated column with a Binding Converter : <telerik:GridViewDataColumn Header="Total" Background="Bisque" DataMemberBinding="{Binding Converter={StaticResource CalculatingConverter}}" TextAlignment="Right" />   The calculation “logic” is in the Convert method of CalculatingConverter.cs   public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) ...
    January 28, 2010
  • Desktop WinForms

    Cascading ComboBoxes Selection in RadGridView for Silverlight and WPF

      A common scenario when entering data is a cascade of comboboxes, where the list in the next combo is populated after selecting a value in the previous. A typical example is selecting a country from a combo then selecting from a filtered list of cities in a second combo. We have had tons of questions on how this can be done within a row in RadGridVIew so I decided to make a small demo. I have used a nice List of countries by continent.           There are lots of ways to achieve this with RadGridView. Bellow I have tried to demonstrate...
    January 27, 2010
  • Web

    Math toolbar for column headers in RadGridView for Silverlight

      A client has recently asked for these little fancy math toolbars in the column header. I found it a great idea and thought it might be useful to share the way of implementing this with RadGridView for Silverlight.   *Since RadGridView for WPF shares the same code base  the approach bellow may be used for both platforms ( Silverlight and WPF ) .   Things are easy with RadGridView !   To have this in your project follow these three easy steps :   1. Copy the MathToolBar user control from the attached sample project (MathToolBar.xaml, MathToolBar.cs). MathToolbarDemo.zip 2. Replace the default header in the column with the user control. <telerik:GridViewDataColumn ... <telerik:GridViewDataColumn.Header> <local:MathToolBar HeaderText="Value1"/> </telerik:GridViewDataColumn.Header> </telerik:GridViewDataColumn>   3. Adjust...
    January 22, 2010
  • Web

    How To: Customize RadGridView's Default Filtering Control with Attached Behaviors (Silverlight &amp; WPF)

    If you are familiar with the RadGridView‘s Custom Filtering Functionality you probably know that you can create any kind of user control to replace the default one which looks like this: Very often, however, you may be perfectly happy with the stock filtering control, but you wish you could modify and adapt it just a little bit to match your particular requirements. What should you do then? Maybe build an entirely new filtering control from scratch that looks just like RadGridView’s default one and adds this tiny bit of functionality? No, that would be insane. There is an easier way to do this....
    January 22, 2010
  • Web

    MicroModels for Silverlight

    Last week I was impressed by Paul Stovell’s marvelous project – MicroModels. In a nutshell a micro model is a view model over your objects, which allow you to define dynamic properties, collection and commands. You can read more about it in Paul’s introductory blog post here. Despite its great features, “MicroModels” has one big limitation - it does not run in Silverlight. And this is where my journey began. My mission was to port the code to Silverlight with little to no modifications. Porting the code to Silverlight The task was not an easy one, but after a lot of head scratching...
    January 21, 2010