What’s New in the Silverlight DataGrid in Beta 2


Silverlight 2 Beta 2 was released this weekend, see what ScottGu has to say about it here.  We’ve all been pretty busy since releasing Beta 1 at MIX, and there are a lot of great new features across the product as a result.  The question that you might be asking is what has changed in the DataGrid?  Check out this list of new features and their associated posts to find out.

New Features Overview

  • Auto-sizing: Unlike Beta 1 when you had to specify widths and heights yourself, everything in the DataGrid now can be auto-sized.  That includes the DataGrid itself, Columns, Rows, Headers, and Row Details.
  • Sorting: Now any time you bind the DataGrid to a collection that implements IList such as a List<T> you now get sorting for free.  Even better sorting isn’t limited to a single column, but end users can sort by multiple columns by holding Ctrl and clicking on additional column headers.
  • Column Reordering: In Beta 1 the order of columns could be set programmatically, but now in Beta 2 we have extended this capability to the end user, where column reordering can be performed at runtime just by dragging a column’s header.
  • Frozen Columns: This is a semi-advanced feature, but once you know about it you’ll be surprised at how useful it can be.  A frozen column does not scroll horizontally but rather is "frozen" in place.  This is the same as the Freeze Column feature in Excel.
  • Programmatic Scrolling: Now you can scroll columns and items into view to make sure that an item you want to highlight to your user is visible on screen.
  • Performance Enhancements: One of the big points of feedback we got in Beta 1 was vertical scrolling speed needed to be faster.  We’ve made some improvements in this space to speed things up.
  • API Improvements: These are changes that we made to existing API’s to try to make using the DataGrid easier.  Hopefully they are all for the better, and we would love to hear your feedback if you think that something could be easier.
Comments (9)

  1. This post is one in a series of posts outlining the new functionality delivered in Silverlight 2 Beta

  2. This post is one in a series of posts outlining the new functionality delivered in Silverlight 2 Beta

  3. Neil Weber says:

    Yo, Scott, please include a post about frozen columns.  I tried it out the other night and the columns still scrolled so I must have done something wrong.

  4. Lots of links again tonight: ToolTip Control by Martin Mihaylov, Scott Morrison(3) on DataGrid, VSM by

  5. prejeshvp says:

    What is the use of background color property? . i have set height,width as of grid as 300,300 and added only one row and backround as balck. backround color is not reflected in empty rows area.

  6. Alex says:

    I’ve made a simple sample stock quote application with DataGrid and the CPU usage is dramatic. It’s 50% on Core 2 Duo 2 Ghz for 15 row and 10 columns grid updated from an async WebService (invoked every 1s by).

    Am I doing somthing wrong or it will be fixed in a release?

    thank you

  7. Jeff says:

    The font in the datagrid is very blurry. When can MS fix it?

  8. Raag says:

    hi,

    How to display the header if there is empty records.

    Regards

    Raag

  9. Jamie Portolese says:

    I’m working on a set of tutorials that make use of a listbox and a "details view" in the form of a Datagrid.  These two items are inserted into a stackpanel. After inserting the data from my db into the listbox the listbox automatically creates scrollbars but when I click on a single line of the list and activate the grid I get a non-scrollable datagrid (more fields are inserted than can be shown on the page).  Do you have to switch on a property to make the datagrid scrollable?  I read somewhere there was an issue with a datagrid within a stack panel.  Is this a bug?

    Any info would be greatly appreciated.  

    Jamie Portolese

    GIS Administrator

    Town of Weymouth MA