Migrating from Version 2.x
Although every attempt was made to prevent breaking interface changes between versions 2.x and 3.0, some were inevitable. This topic lists the most notable changes as well as provides a list of the members that were rendered obsolete.
Behavior Changes
- The
AutoCreateItemPropertiesproperty was added to theDataGridCollectionViewandDataGridCollectionViewSourceproperties with a default value of true; therefore, as of version 3.0, all item properties (i.e., columns) will be added to the grid and not only the ones defined in the ItemProperties collection. Setting theAutoCreateItemPropertiesto false will revert back to the expected 2.0 behavior. - Because the ValidationMode property was made obsolete and a major overhaul of the validation behavior was done for version 3.0, some validation behaviors may have changed. These can include:
-
- The focus no longer remains in a cell when it is in error when the ValidationMode was set to CellEndingEdit.
-
- UI validation rules (
CellValidationRules) are always validated when a cell exits edit mode or when the new value is updated in the source.
- UI validation rules (
-
- Errors reported by
IDataErrorInfowill now be caught.
- Errors reported by
Breaking Interface Changes
- The AutoFilterValues property is now read-only on the
DataGridCollectionView,DataGridContext, andDataGridDetailDescriptionclasses. - The BeginEdit, EndEdit, and CancelEdit methods on the
RowandCellclasses are no longer virtual and have been replaced by their virtual BeginEditCore, EndEditCore, and CancelEditCore counterparts. - The
Initializemethod on theCellclass is no longer virtual and has been replaced by its virtual InitializeCore counterpart. - The
Widthproperty on theColumnclass is now aColumnWidthvalue rather than a double. - The
EndNewimplementation of theICancelAddNewinterface on theDataGridCollectionViewis now explicit rather than implicit. - The
ICustomItemContainerGeneratorinterface contains new members that need to be implemented on any classes that implement this interface. - The
DropMarkOrientationenumeration has been moved from theXceed.Wpf.DataGridnamespace to theXceed.Wpf.DataGrid.Viewsnamespace. - The attached versions of the
CardView.CardTitleBackground,CardTitleForeground,CardTitleTemplate,HideEmptyCells,InsertionCardTitleTemplate, andStatCardTitleTemplateproperties have been removed as they were not supported.
Obsolete Members
The following table provides a list of the members that were rendered obsolete and their replacement.
| Obsolete member | Replacement member | Type |
|---|---|---|
| RowSelectorPane.ItemsPlacementReference property | None | Error |
| RowSelectorPane.RowSelectorStyle attached property | RowSelector.RowSelectorStyle attached property | Error |
| RowSelectorPane.ScrollViewer property | None | Error |
| DataGridControl.AddingNewDataItem event | DataGridCollectionView.CreatingNewItem and InitializingNewItem events | Warning |
| DataGridControl.ItemsPanel property | DataGridItemsHost class | Warning |
| DataGridControl.ValidationMode property | See Editing and Validating topic | Warning |
| Column.DisplayMemberBinding property | Column.DisplayMemberBindingInfo property | Warning |
Inheritance Changes
The CellCollection class now derives from Collection rather than ObservableCollection. The GroupConfiguration class now derives from Freezable rather than directly from DependencyObject. The RowSelectorPane class now derives from Panel rather than Canvas.
What Happened to ActualContent?
The ActualContent property was an internal property. Although binding to it in XAML worked (as long as the application has full trust), it was only a temporary workaround. It was one of our goals for version 3.0 to get rid of ActualContent and to make it so that the Cell's Content property was always "live" with the business object. From now on, the Cell's Content property will always return the current content of the cell.
Let's take the following scenario: If a business object's "quantity" property is set to 10 and you enter edit on a DataGridControl's DataRow to change the "quantity" cell to 20: In version 2.0, the Cell's Content property would still be set to 10 and the internal ActualContent property would be set to 20. With version 3.0, the Cell's Content would now be equal to 20, even if the cell and/or the row is still in edit mode. The business object's "quantity" property will still be equal to 10 until the binding between the cell's Content property and the business object is updated. The moment when this binding updates the source is controlled via the DataGridControl's UpdateSourceTrigger property. Its default value is RowEndingEdit, meaning that each of the row's cells Content will be sequentially pushed to the business object as soon as the row tries to end its edit process.
The other UpdateSourceTriggers are : CellEndingEdit, which means that the cell will push its content to the source as soon as it tries to end its edit process, even if the row is still being edited. CellContentChanged, which means that the cell will push its content to the source as soon as its Content property changes... this could very well mean that it could update your business object at each key stroke made in a cell editor. Therefore, as of version 3.0, all bindings to the ActualContent property must be changed to the Content property instead.
Known Issues
Implicit DataTemplates are no longer detected and must be explicitly assigned to the appropriate column's CellContentTemplate property.