• .NET

    Breadcrumb hierarchy navigation for RadGridView

    For my first blog post I’m going to present a little pet project inspired by requests from some of our customers. And so, without further ado: The Breadcrumb is a simple control that analyzes the type of the collection found in the RadGridView’s ItemsSource property and automatically resolves data hierarchies. Usage is pretty straight-forward. Place the control anywhere you like and then connect it to the RadGridView, all in XAML. Example: <bread:Breadcrumb Grid.Row="0" Margin="5" SourceGridView="{Binding ElementName=radGrid}"/> The logic behind the type analysis algorithm is simple: represent every collection as a generic IEnumerable<> and get the type of the generic argument. So if you have an array of...
    May 31, 2010
  • .NET

    Enable RadGridView’s rows reorder functionality using Behaviors

    Using RadControls can boost the development process, using bunch of built-in features. However, sometimes we encountered scenarios where we need something very specific. In addition, we do want to make our custom logic encapsulated and easy reusable.  So,when this is the case,using behaviors is our best choice. In this blog I will show small example how to use the behavior power to enable row reorder functionality.     In order to enable drag and drop functionality, it simply uses our RadDragAndDropManager, giving us simple solution for the drag/drop functionality. So in order to use it and customize it we can even go the...
  • .NET

    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...
  • .NET

    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...
  • .NET

    RadGridView for WinForms vNEXT is coming

    The new version of RadGridView is coming in May (as beta) and I am eager to show you some of the new features. There are many methods to indicate errors in RadGridView. However, until now it didn’t support the most natural and easy way for this - the IDataErrorInfo interface. Things have changed, so let me show you how to use this interface.   As MSDN says,“IDataErrorInfo provides the functionality to offer custom error information that a user interface can bind to.” Actually, you don't need to know anything about this interface. You can just set the ErrorText property of the desired row or cell: this.radGridView1.Rows[5].ErrorText = "There...