September 11, 2008

[WPF] – WPF DataGrid is finally released in .NET framework 3.5 SP1

WPF is proud to introduce the new DataGrid control and our control improvements for 3.5 SP1! In 3.5 SP1, the WPF Controls team invested heavily in improvements to our controls infrastructure to enable a performant, full-featured DataGrid in our next release. A CTP of our new DataGrid control is available on CodePlex.

Here’s a quick list of the features you’ll find in the DataGrid CTP which is available now on the WPF Codeplex site:

  • Auto-generation of Columns. Simply hook up the DataGrid to an ItemsSource and at runtime it will auto-populate with variety of pre-built column types. You can also hook into column generation events to modify the columns as they’re created, or specify columns in the XAML.
  • Variety of Column Types. Text, CheckBox, ComboBox, Button, and Hyperlink columns are standard column types. You can also use the TemplateColumn to create your own custom column.
  • Row and Column Headers. Headers for both rows and columns can be toggled on and off.
  • Grid Lines. Horizontal and vertical grid lines can be toggled on and off and styled.
  • Column Width Behaviors. Columns can be set to auto-size to header or cell content, fill the remaining space (* behavior), respect max and min values, or set to an absolute width.
  • Cell Editing. Edit cell content and submit changes back to the database.
  • Selection. Row-only, cell-only, or row and cell selection can be enabled.
  • Keyboard Navigation. The entire grid can be navigated with keyboard only.
  • Column Resizing and Reordering. Columns can be resized and reordered programmatically or by the user through drag and drop in the UI.
  • Column Sorting. Columns support sorting and multi-sorting by end-user and programmatically.
  • Fully Style-able and Template-able. The DataGrid and all of its elements are fully style-able and template-able. Customize the look and feel of the grid, or make it look nothing like a grid at all (e.g. card view).
  • Add and Remove Rows. Add new items to the DataGrid or delete items from it. Customize the default value for a new row.
  • Row Validation. Create groups of validation rules to apply to rows.
  • Filtering/Grouping Support. Support for filtering and grouping data through CollectionViews.
  • Clipboard Operations. Built-in Copy support with extensibility for Cut and Paste.
  • Performance. Strong performance for scenarios with thousands of rows and many columns.

Features still to come include:

  • Readonly. Readonly at the grid and column level.
  • Row Details. Rows can expand to show and hide additional fields.
  • Hidden Columns. Hide columns without removing them from the collection.
  • New Column Types. Additional column types, including Image column.
  • Automation. Full automation peers for accessibility and testing.

Some useful links:

Now what are you waiting for? Let’s enjoy it (^_^)


No comments: