Telerik blogs

Latest

  • Desktop WPF

    Displaying data quickly in the RadGridView for WPF

    The RadGridView for WPF uses the ItemsSource property for binding data.  ItemsSource is actually of type System.Object which not only allows you to bind to any data source that implements IEnumerable, but also the ADO.NET DataTable and DataSet.  In this post, I am going to demonstrate how you can quickly bind data to the RadGridView for WPF.  The task will be to build a car repair shop application which will display all the cars currently in the shop.  To get started we need to have some data, so we will use a simple class to store Car information.       public class Car       {           public string Make { get; set; }...
    January 20, 2009
  • Desktop WPF

    Detail row for your WPF DataGrid with ADO.NET DataService binding

    Using GridViewRow template and simple trigger you can define, style and show details for every data row in your RadGridView very easily:      <Style TargetType="{x:Type telerik:GridViewRow}">         <Setter Property="Template">             <Setter.Value>                 <ControlTemplate TargetType="{x:Type telerik:GridViewRow}">                      <!--Your template goes here -->                 <ControlTemplate.Triggers>                     <MultiTrigger>                        <MultiTrigger.Conditions>                           <Condition Property="IsSelected" Value="True" />                           <Condition Property="IsCurrent" Value="True" />                        </MultiTrigger.Conditions>                        <SetterProperty="Visibility" TargetName="GroupBox" Value="Visible" /> ...
    January 19, 2009
  • Desktop WPF

    Grouping data in the RadGridView for WPF

    When you first add the RadGridView to your WPF application you will undoubtedly notice the section at the top of the control which I have outlined in red.  This area is officially called the GridViewGroupPanel, but I am just going to call it the Group Panel to save myself some typing.  The Group Panel allows the user to drag and drop column headers into the panel in order to group the data in the RadGridView at runtime.  Below you will see that I have grouped my data by the "Make" column in my grid of vehicles. Additionally, the sort order of...
    January 17, 2009
  • Desktop WPF

    Master/Detail with RadGridView for WPF using ObjectDataProvider and ADO.NET Entities

    In my previous post, I showed how to instantiate LINQ to SQL DataContext using ObjectDataProvider in WPF. With ADO.NET Entities you can do something similar: <Grid.Resources> <ObjectDataProvider x:Key="customers" ObjectType="{x:Type local:NorthwindEntities}" MethodName="get_Customers"> </ObjectDataProvider> <ObjectDataProvider x:Key="orders" ObjectType="{x:Type local:NorthwindEntities}"...
    January 16, 2009
  • Desktop WPF

    How To: WPF declarative binding to LINQ to SQL using ObjectDataProvider

    With ObjectDataProvider you can easily instantiate LINQ to SQL DataContext and request desired ITable using GetTable method: <Window x:Class="WpfObjectProviderWithLinqToSql.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:local="clr-namespace:WpfObjectProviderWithLinqToSql" Title="How to bind declaratively LINQ to SQL DataContext using ObjectDataProvider" Height="400" Width="500" ResizeMode="NoResize"> <Grid> <Grid.Resources> <ObjectDataProvider x:Key="customers" ObjectType="{x:Type local:NorthwindDataContext}" MethodName="GetTable"> ...
    January 14, 2009