Xceed WPF DataGrid – Part 1

Vendor Choice

Having met a number of obstacles in getting Microsoft’s WPF DataGrid control to function as I required I decided it may be prudent to look at some of the other offerings. In the past I’ve been a big fan of the DevExpress suite of WinForms controls.

However, DevExpress have been a little slow to get on the WPF bandwagon. In fact even now (April 2009) their grid control is still only in Beta (expecting release in mid 2009). That’s a two full years behind the offerings from Xceed and Infragistics – what were they thinking!? Even if they did release now I’m really not sure I want to be working with a v1 DataGrid control when other vendors have more mature products available.

I remember taking a look at the Xceed WPF DataGrid when it first appeared – back in early 2007. At the time I found the demo app to be quite off-putting. All orange glow and black gloss with ridiculously rounded corners.

However, whilst searching the internet for clues on using Microsoft’s WPF DataGrid I had stumbled across a number of posts/articles related to the Xceed grid. In fact many more so than any other WPF grid control. So from this I figured it must have an active community, which got me to thinking that maybe it was time to see how far the Xceed offering has come in the last two years?

Comparison against Microsoft’s WPF DataGrid

So how does the Xceed DataGrid stack up against Microsoft’s? Here are some of the benefits that I’ve found so far:

  • Binding to SelectedItem works just fine.
  • ReadOnly properties support at Grid, Column and Row level.
  • CheckBox column allows simple styling whilst preserving ReadOnly value.
  • Automatically supports current selection and edit indicators in the row header.
  • The grid theme matches the OS theme out of the box. This is how it should be. Sure the grid can be custom styled to suit but it only makes sense that by default the grid should match the look and feel of the standard themed controls.
  • When auto-generating column headers it correctly uses any System.ComponentModel.DisplayName attributes that have been applied to the underlying class.
  • There are lots of options at grid and column level that determine how a cell should enter edit mode. This is very useful for columns such as CheckBox columns where requiring a click to enter edit mode can be highly annoying (since the user would expect the click to toggle the checkbox).

In short – most of the stumbling blocks that I’ve hit getting the Microsoft WPF DataGrid to do something pretty trivial “just work” with the Xceed grid. That’s not to say there was no learning curve at all – I had to wrap my head around setting the ItemsSource to a DataGridCollectionView rather than direct to a ObservableCollection<T> to get anything to display for a start. But this was glaringly obvious as soon as I looked at any of the samples and “how to” guides. The supplied documentation is OK, but what impressed me most was the feedback provided on Xceeds community forums. Some really good answers provided by the Xceed team in an ultra timely fashion.

So what could be improved with Xceed’s DataGrid? Well, its a little early for me to provide a comprehensive list here – but off the cuff I’d make the following suggestions:

  • An easier mechanism for custom sorting. Rather than having to specific custom IComparer implemenations often it is easier to refer to an unbound property that contains the raw data. Like Microsoft’s SortMemberPath property. Hmm… I wonder if you could use a generic SortComparer to provide the same functionality?
  • Smaller assembly size. I know these days 2.08Mb shouldn’t be an issue but for my current contract it is. We have a ClickOnce application that is deployed to machines in remote country areas. Many of these machines are still using dial-up! Adding another another 2Mb to our current 4.5Mb total is a decision not to be made too lightly. [We’ve already been burned with a ridiculously bloated NHibernate assembly (1.6Mb)]

As much as I’ve had fun with the Microsoft DataGrid I’m now considering making the Xceed’s my DataGrid of choice – certainly for my own projects. Expect to see a few more posts on the Xceed DataGrid coming up soon.


Microsoft WPF DataGrid – www.codeplex.com/wpf

Xceed WPF DataGrid – www.xceed.com

13 thoughts on “Xceed WPF DataGrid – Part 1”

  1. I haven’t played with the Telerik one Dave – but one distinct advantage that Xceed and Infragistics (and Microsoft) offer is that they have a free “Express” version. As far as I could find the Telerik one is around US$800 bundled with other WPF controls (that you may or may not want). Of course a free grid that doesn’t do what you need isn’t much good – but they appear to cover off on the basic functions.

  2. I was going to say that you can buy it for $99, but I misread the site. You are right, they only appear to sell all the WPF controls as a bundle for $999 (including updates, support & source code)

    This seems to be a change from the past – as I know you used to be able to purchase a single ASP.NET control.

    I’ve learned something today.

  3. Thanks very much. Very good. Syncfusion are also in beta. I was going to look at the MS grid but I think I’ll stay with Xceed. Thanks

  4. Hello David,

    The good news is that Telerik is giving away free licenses for RadControls for WPF to all MSDN Subscribers. These licenses do not include dedicated support (only community support is available), but they are otherwise identical to the commercial WPF licenses ($999).

    To download a free Telerik WPF license, you need to log into your MSDN account and visit the ‘Special Offers’ section. The offer is valid until the end of June.

    Hope this was useful.

  5. Might as well point out also that the Express Edition of Xceed DataGrid for WPF will no longer be free as of June 15th, so there’s only 6 days left to register for free, after that it goes to $300. This is the same mature product as the professional edition, but with some features removed, though still very powerful. http://xceed.com/freegrid

  6. Hey, that was interesting,
    Thanks very much. Very good. Syncfusion are also in beta. I was going to look at the MS grid but I think I’ll stay with Xceed. Thanks
    Keep up the good work

  7. Greeting,

    Good write up. I noticed a nugget in your write up about one of the the Xceed DataGrid’s features “…auto-generating column headers it correctly uses any System.ComponentModel.DisplayName attributes…”.

    I assume this to mean that you can decorate a property (for example) with a DisplayName attribute and that attribute will then be used as the column-header. I have been looking for this exact thing in order to provide an abstract ViewModel for a DataGrid and have the columns correspond to the “property” it is bound to.

    I am a bit confused on how I need to setup the DataGrid and the display attributes to accomplish this. Do you have any quick example on how this would be impemented?


  8. Bruce,

    Use the DisplayName attribute like you’ve said:


    DisplayName(“Date of Birth”)]
    public DateTime? DateOfBirth
        get { return _dateOfBirth; }
            SetValue(ref _dateOfBirth, value, “DateOfBirth”); // Fire PropertyChanged

    Then in the XAML create a DataGridCollectionViewSource:

    xcdg:DataGridCollectionViewSource x:Key=”personView”
    ItemType=”{x:Type local:Person}”
        Source=”{Binding Persons}”

    Then in the XAML create the DataGridControl itself bound to your source:

        ItemsSource=”{Binding PersonView}”
        SelectedItem=”{Binding SelectedPerson}”
        EditTriggers=”BeginEditCommand, ClickOnCurrentCell, ActivationGesture”
        CellEditorDisplayConditions=”RowIsBeingEdited” ItemScrollingBehavior=”Immediate”>
            <xcdg:TableView ShowFixedColumnSplitter=”False”
    =”1″ VerticalGridLineThickness=”1″ UseDefaultHeadersFooters=”False”>
                        <xcdg:InsertionRow />
    <xcdg:ColumnManagerRow />
            <xcdg:Column FieldName=”FirstName” IsMainColumn=”True” Width=”80″/>
            <xcdg:Column FieldName=”LastName” Width=”80″ />
    <xcdg:Column FieldName=”DateOfBirth” Width=”80″ />

    For more details I’d recommend searching the Xceed support forum.

  9. The problem was that certain feeds may have thousands of items and bringing this data back from a web service may be very costly in terms of bandwidth and perform poorly from the user experience perspective.

  10. Poly Water Tanks,

    If bandwidth is costly and you’re worried about poor user experience, why not use a combination of Asynchronous Data Virtualization, and smooth scrolling. These are both built-in features in the latest Xceed DataGrid for WPF, and are pretty easy to set up.

    With Asynchronous Data Virtualization, the datagrid will load only the data currently on the screen, plus some before and after for those first page up/page downs. As the user scrolls, the datagrid, in the background without disturbing the UI, will fetch additional data.

    Combined with the smooth scrolling, which gives an animation that lasts about a second, plus smooth fade-in of incoming data (fetched by the background data virtualization) means that the user experience is great, even when data takes time to appear. The animation gives the grid more time and the end user feels that something is happening.

    You saw the Bing Bling demo that uses this? (http://xceed.com/bingbling)

    Note: that listbox is actually a 1-column Xceed DataGrid for WPF with no column header. The 3-dot animation of “loading data” is also built-in.

  11. Bruce,
    In case your following this and have found the answer, care to share?

    Not quite the solution I (or Bruce I think too) am looking for. Don’t want to hard code column info in the xaml. Needs to be dynamic.


Comments are closed.