Telerik blogs

Latest

  • Desktop WPF

    Easy programmatic UI customization for WPF and Silverlight

    I’m pleased to announce that with Q1 2009 release of RadControls for WPF / Silverlight you will be able to manipulate the controls very easily with two powerful extension methods: ParentOfType<> and ChildrenOfType<>. Here are several small demos for RadGridView: 1) Get all grid rows:      var rows = RadGridView1.ChildrenOfType<GridViewRow>(); 2) Get all grid cells:      var cells= RadGridView1.ChildrenOfType<GridViewCell>(); 3) Get all grid header cells:      var headerCells = RadGridView1.ChildrenOfType<GridViewHeaderCell>(); 4) Get (and show) new row:      var newRow = RadGridView1.ChildrenOfType<GridViewNewRow>().First();     ...
    February 03, 2009
  • Desktop WPF

    WPF How To: Endless scrolling of 2mil. records using BackgroundWorker and LINQ to SQL

    I’ve made small demo how to create easily endless scrolling of almost 2 mil. records (exact count is 1770607) using RadGridView for WPF. When you reach the bottom of the vertical scrollbar, more data will be retrieved on-the-fly from the data-base server: For asynchronous data loading you can use BackgroundWorker: BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += new DoWorkEventHandler(worker_DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); worker.RunWorkerAsync(); … void worker_DoWork(object sender, DoWorkEventArgs e) { NorthwindDataContext context = new NorthwindDataContext(); queryable = from o in context.Orders from od in context.Order_Details ...
    February 02, 2009
  • Desktop WinForms

    Quickly Formatting Data with the RadGridView for WinForms

    Most developers have encountered a need at some point to modify how data is displayed to the user.  The RadGridView offers a very straightforward way to format data without having to modify the source data.  For example, you may not want the time displayed with a DateTime field, or you want to change the structure of the data to meet an internal standard.  The screenshot below shows three different fields which display the default DateTime format. This may be valid data, but it may not be useful to the user and we could potentially save screen real estate by eliminating...
    January 30, 2009
  • Desktop WPF

    Displaying Hierarchy in RadGridView for WPF

    Building on my previous post where I talked about how to bind data to the RadGridView, today I want to show how you can display hierarchical data in the grid.  I will follow the same concept of building an application for a car repair shop to manage vehicles in for repair.  I will leverage two classes to display the data.  The original Car class which was used previously and a new CustomerComplaint class.  The Complaint property of the Car object was initially a string, but we need to allow for several issues to be reported so we will use the CustomerComplaint class to...
    January 22, 2009
  • 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