Conditional styles and templates with RadGridView for Silverlight and WPF

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Thu, 01 Apr 2010 00:00:00 GMT Indexed on 2010/04/01 8:53 UTC
Read the original article Hit count: 460

Filed under:

Im happy to announce that with our upcoming Q1 2010 Service Pack 1 (middle of April) you will be able to apply conditionally styles and templates for RadGridView easily using DataTemplateSelectors and StyleSelectors for both Silverlight and WPF:

image

You can test the new functionally with our upcoming latest internal build this Friday and in the meantime here is an example:

XAML

<Grid  x:Name="LayoutRoot">
<Grid.Resources>
<local:MyStyleSelector x:Key="styleSelector" />
<local:MyDataTemplateSelector x:Key="templateSelector" />
</Grid.Resources>
<telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding}" RowStyleSelector="{StaticResource styleSelector}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" CellTemplateSelector="{StaticResource templateSelector}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
 
 

C#

public class  MyStyleSelector  : StyleSelector
{
public override ...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner