Telerik blogs

Latest

  • Desktop WPF

    Styling RadChart for WPF and Silverlight gets easier

    It’s been awhile since the Q1 SP1 2010 release, but let me introduce you to a couple of new approaches to styling, which we added and failed to openly manifest. First, there is the ability to build your own palette of brushes, that will be applied to the RadChart: <telerik:RadChart x:Name="radChart1"> <telerik:RadChart.PaletteBrushes> <SolidColorBrush Color="Magenta" /> <LinearGradientBrush StartPoint="0,0" EndPoint="0.75,1"> <GradientStop Color="Red" Offset="0" /> <GradientStop Color="BlueViolet" Offset="0.5" /> <GradientStop Color="#af000000" Offset="1" /> </LinearGradientBrush> </telerik:RadChart.PaletteBrushes> </telerik:RadChart> .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; }   Here is the result:   Using images is as...
    May 17, 2010
  • Desktop WPF

    TreeView in ComboBox with RadControls for Silverlight or WPF, final take

    It seems that there are many developers that want to use this combo, as my previous blog posts are quite popular. The problem with the suggested solution is that you need to customize the control template of RadComboBox. There is a much easier way to put a RadTreeView in a Popup – by using a RadDropDownButton: <telerik:RadDropDownButton HorizontalContentAlignment="Left" DropDownWidth="200" IsOpen="{Binding SelectedItem, Converter={StaticResource ObjectToFalseConverter}, ElementName=TreeView, Mode=TwoWay}" Content="{Binding SelectedItem.Text, FallbackValue='Please, select an item.', ElementName=TreeView}"> <telerik:RadDropDownButton.DropDownContent> <telerik:RadTreeView x:Name="TreeView" ItemsSource="{StaticResource Items}" ItemTemplate="{StaticResource ItemTemplate}" /> </telerik:RadDropDownButton.DropDownContent> </telerik:RadDropDownButton> .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; }   This way you could easily access the RadTreeView instance in the code-behind, however I would recommend using a ViewModel and bindings instead.   The DropDownButton Content property is bound to the SelectedItem property of...
  • Desktop WinForms

    Styling Cells in RadGridView for WinForms

    In RadGridView you have to handle the CellFormatting event when you want to customize the look and feel of grid cells. This is so because RadGridView uses UI virtualization. It creates elements only for cells that are currently visible - when scrolling they are reused. Of course, it will be much easier if we could access the cell directly and set its visual properties without an event. In our next release (Q2 2010) this will be possible. By using the Style property you can set the desired background color or change the font size. Here is a sample: this.radGridView1.Rows[5].Cells["Name"].Style.BackColor = Color.Red; this.radGridView1.Rows[5].Cells["Name"].Style.Font = new Font(SystemFonts.DialogFont, FontStyle.Italic);   All...
  • Desktop WPF

    Using RadRibbonWindow with RadRibbonBar for WPF

    As you can expect, we have received a lot of great feedback from the community regarding RadRibbonBar.  One thing that people always asked about, however, was how to better integrate the RadRibbonBar into the actual window itself.  This way, rather than having the Window title and RadRibbonBar title both displaying, it would provide for a more seamless user experience.  Well, we listened. :) With our latest release, we have included the RadRibbonWindow to the RadControls for WPF library, allowing you to take the old window + RadRibbon combination and create something a little more visually compelling. First we want to add the...
  • Desktop WinForms

    Flexible data conversion with RadGridView for WinForms vNEXT

    One of the new features that will come with the next version of RadGridView is the new data conversion layer. In our daily work we have often got into troubles in visualizing and formatting concrete types as other types. Sometimes the data source is not compatible with the bind target. Hence, you need to create a facade that converts the data to desired type. Let’s say that you bind the grid to a source that is incompatible with the columns that you want to show, for example a GridViewCheckBoxColumn for char field instead of GridViewTextBoxColumn. How can you accomplish that? The new version of RadGridView will...