We have just uploaded a new version of the DataGrid that includes a number of bug fixes and a few behavioral breaking changes from the version that shipped with Silverlight 2. Please
take the time to read through and understand all of the changes before you decide to upgrade your DataGrid. Following this list of changes is a set of instructions on how to start using the new version.
Breaking Changes
An application that uses the DataGrid will still compile but will no longer work as expected if it was dependent on any of the following behaviors.
1.FrozenColumnCount now takes hidden columns into account. Previously, only the first columns with Visibility set to Visible were included in the range of frozen columns. A column with Visibility set to Collapsed
can now be considered frozen even though it isn’t visible. This is to ensure that a column’s DisplayIndex corresponds with the DataGrid’s FrozenColumnCount (i.e. if FrozenColumnCount == 3, columns with DisplayIndex < 3 are considered frozen).
2.The DataGrid’s current cell is now kept in sync with an ICollectionView’s notion of currency. Moving the current position or changing the current item of an ICollectionView will now move the current cell and
selected item of a DataGrid, and vice versa. For this to work, the DataGrid’s ItemsSource must be set to a collection that fully implements ICollectionView.
3.A developer can now programmatically reorder a non-frozen column to the frozen column range (and vice versa) by changing a column’s DisplayIndex. The DataGrid used to throw an exception in these cases. An
end-user, however, is still unable to do this through the UI by dragging column headers.
Bugs Fixed
The following is a list of bugs fixed in the DataGrid since the version released with Silverlight 2.If any application had a workaround for these bugs, the workaround is no longer necessary and should be removed.Its inclusion may cause undesired behavior.
1.Horizontal Gridlines do not show in FillerColumn
2.DragIndicator does not show during reorder when DataGrid is placed inside StackPanel
3.DragIndicatorStyle only exists on the DataGrid level, should also exist at the column level
4.DataGrid doesn't support a disabled state in the main template By default, the DataGrid is now grayed out when IsEnabled == false, and includes a new visual state.
5.EndEdit is called twice Any application accounting for IEditableObject.EndEdit accidentally being called twice by the DataGrid will need to be updated.6.Able to leave edited DataGrid without ever triggering EndEdit
7. Changing ItemsSource while in Editing Mode causes Exception to be thrown
8.Row containing focus disappears after sort or ItemsSource change Any application working around the “disappearing row” issue by manipulating focus within the DataGrid will no longer need to do so, and should be updated.
9.ColumnHeader button pressed visualization should match the new Button pressed visualization
10.SL Designer hits a NullReferenceException while adding an empty HeaderStyle
11.Cells out of view do not always show up when a resize of the DataGrid forces them in view
12.AutoSizedRows keep growing even when the rows are recycled
13.Scrollbar incorrect when ItemsSource changed and DataGrid is on a background Tab
14.Incorrect VerticalScrollbar when setting ItemsSource on DataGrid inside a Popup
15.HorizontalContentAlignment does not have any effect on the DataGridColumnHeader
16.Resizing columns to smaller than column header content removes separator
17.SelectedItem is not updated at the time when the CurrentCellChanged event is raised
Any application accounting for the fact that Selection was out of sync at the time the CurrentCellChanged event was raised will need to be updated.Now the DataGrid will not raise either of the SelectionChanged or CurrentCellChanged events until both selection and currency have been updated.
18.Sorting or Resetting a CollectionView causes incorrect RemovedItems in SelectionChanged event
19.ScrollColumnIntoView does not align correctly if there are frozen columns
20.Reordering a column should only show DragIndicator for valid reorder positions
The DataGrid will now clip the ColumnHeader’s DragIndicator so that it doesn’t show up when dragging a frozen column over a non-frozen column, and vice versa.
21.Adding or removing columns within the frozen column range should not throw exception
22.FrozenColumnCount and the Column’s IsFrozen is getting out of sync when it isn’t visible
23.Exception thrown when sorting a DataGrid that has a list of nullable ints as its ItemsSource
24.CellStyle Background property doesn’t work
Previously, setting the Background property inside of CellStyle had no effect.Applications with unique CellStyles should ensure that the desired background color is applied.
25.CellStyle is not applied to Filler Column
26.Setting a DataGrid style that overwrites the template after the original template has been loaded causes an Argument exception
27.Cannot hold editing mode when using a DatePicker or ComboBox in editing template
There was a bug that prevented any editing control that uses a Popup to work correctly in the DataGrid.As soon as the Popup opened, the DataGrid would lose focus and automatically CommitEdit.It now tracks focus within a child Popup in order to support DatePicker, ComboBox and any other editing control that opens a Popup.
28.Double-click required on external Buttons when in editing mode
A single click on Buttons (or any other control that handles MouseLeftButtonDown) outside of the DataGrid will now register correctly.Previously, if the user was in editing mode, the first click would CommitEdit and the second click would register on the Button.
29.Sorting or resetting the ItemsSource does not raise UnloadingRow events
30. Contents of columns out of view do not always show up when the DataGrid is resized such that they are brought into view
Installation Instructions
Visit the Silverlight
2 DataGrid December 2008 Release download page and read the installation instructions carefully. In order to successfully use the new DataGrid you
must do the following.
1.Close all instances of Microsoft Visual Studio.2.Delete all cached toolbox items by removing all files beginning with "toolbox" from %LocalAppData%\Microsoft\VisualStudio\9.0.
On Microsoft Windows XP, %LocalAppData% is Documents and Settings\UserName\Local Settings\Application Data.
On Microsoft Windows Vista, %LocalAppData% is Users\UserName\AppData\Local.
3. Replace the following assemblies with the ones in this package:
"15.HorizontalContentAlignment does not have any effect on the DataGridColumnHeader"
YES! I have been waiting for that one, should fix alot of the dynamic resizing now... Now I hafta remove my DataView I made to replace DataGrid. Thanks alot for the update, it was much needed here!
The MouseOver, Selected, and Current states on the DataGridCell should be working. Please let us know if you find otherwise. Previously there was a bug where the cell's Background could not be styled, but that was fixed in our mini release.
Thanks much for the post. But I guess how does the end user gets the new grid? If I have a app that uses the new grid, how does the above mentioned dlls get to user's machine?
The DataGrid is not part of the Silverlight core package. You got the original dll from the SDK and compiled your app with it. Everything in your app that's not part of the core assemblies is packaged into a xap (including the DataGrid dll) file. That
xap file is downloaded by any user viewing your Silverlight page. As a result, as long as you build your app with the new DataGrid dll's, your customers will be using the new version as well.
Let the force be with you and the Silver Light development team. I was waiting for this since the RTW. Now I can have at-least few good night sleep. Wish you and all of us a very happy 2009 with SL2-SL2.5-SL3.......
Brian Braeckel
Member
384 Points
69 Posts
Silverlight 2 DataGrid December 2008 Release
Dec 19, 2008 06:51 PM | LINK
Silverlight 2 DataGrid December 2008 Release
We have just uploaded a new version of the DataGrid that includes a number of bug fixes and a few behavioral breaking changes from the version that shipped with Silverlight 2. Please take the time to read through and understand all of the changes before you decide to upgrade your DataGrid. Following this list of changes is a set of instructions on how to start using the new version.
Breaking Changes
An application that uses the DataGrid will still compile but will no longer work as expected if it was dependent on any of the following behaviors.
1. FrozenColumnCount now takes hidden columns into account. Previously, only the first columns with Visibility set to Visible were included in the range of frozen columns. A column with Visibility set to Collapsed can now be considered frozen even though it isn’t visible. This is to ensure that a column’s DisplayIndex corresponds with the DataGrid’s FrozenColumnCount (i.e. if FrozenColumnCount == 3, columns with DisplayIndex < 3 are considered frozen).
2. The DataGrid’s current cell is now kept in sync with an ICollectionView’s notion of currency. Moving the current position or changing the current item of an ICollectionView will now move the current cell and selected item of a DataGrid, and vice versa. For this to work, the DataGrid’s ItemsSource must be set to a collection that fully implements ICollectionView.
3. A developer can now programmatically reorder a non-frozen column to the frozen column range (and vice versa) by changing a column’s DisplayIndex. The DataGrid used to throw an exception in these cases. An end-user, however, is still unable to do this through the UI by dragging column headers.
Bugs FixedThe following is a list of bugs fixed in the DataGrid since the version released with Silverlight 2. If any application had a workaround for these bugs, the workaround is no longer necessary and should be removed. Its inclusion may cause undesired behavior.
1. Horizontal Gridlines do not show in FillerColumn
2. DragIndicator does not show during reorder when DataGrid is placed inside StackPanel
3. DragIndicatorStyle only exists on the DataGrid level, should also exist at the column level
4. DataGrid doesn't support a disabled state in the main template
5. EndEdit is called twiceBy default, the DataGrid is now grayed out when IsEnabled == false, and includes a new visual state.
Any application accounting for IEditableObject.EndEdit accidentally being called twice by the DataGrid will need to be updated. 6. Able to leave edited DataGrid without ever triggering EndEdit
7. Changing ItemsSource while in Editing Mode causes Exception to be thrown
8. Row containing focus disappears after sort or ItemsSource change
Any application working around the “disappearing row” issue by manipulating focus within the DataGrid will no longer need to do so, and should be updated.
9. ColumnHeader button pressed visualization should match the new Button pressed visualization
10. SL Designer hits a NullReferenceException while adding an empty HeaderStyle
11. Cells out of view do not always show up when a resize of the DataGrid forces them in view
12. AutoSizedRows keep growing even when the rows are recycled
13. Scrollbar incorrect when ItemsSource changed and DataGrid is on a background Tab
14. Incorrect VerticalScrollbar when setting ItemsSource on DataGrid inside a Popup
15. HorizontalContentAlignment does not have any effect on the DataGridColumnHeader
16. Resizing columns to smaller than column header content removes separator
17. SelectedItem is not updated at the time when the CurrentCellChanged event is raised
Any application accounting for the fact that Selection was out of sync at the time the CurrentCellChanged event was raised will need to be updated. Now the DataGrid will not raise either of the SelectionChanged or CurrentCellChanged events until both selection and currency have been updated.18. Sorting or Resetting a CollectionView causes incorrect RemovedItems in SelectionChanged event
19. ScrollColumnIntoView does not align correctly if there are frozen columns
20. Reordering a column should only show DragIndicator for valid reorder positions
The DataGrid will now clip the ColumnHeader’s DragIndicator so that it doesn’t show up when dragging a frozen column over a non-frozen column, and vice versa.21. Adding or removing columns within the frozen column range should not throw exception
22. FrozenColumnCount and the Column’s IsFrozen is getting out of sync when it isn’t visible
23. Exception thrown when sorting a DataGrid that has a list of nullable ints as its ItemsSource
24. CellStyle Background property doesn’t work
Previously, setting the Background property inside of CellStyle had no effect. Applications with unique CellStyles should ensure that the desired background color is applied.25. CellStyle is not applied to Filler Column
26. Setting a DataGrid style that overwrites the template after the original template has been loaded causes an Argument exception
27. Cannot hold editing mode when using a DatePicker or ComboBox in editing template
There was a bug that prevented any editing control that uses a Popup to work correctly in the DataGrid. As soon as the Popup opened, the DataGrid would lose focus and automatically CommitEdit. It now tracks focus within a child Popup in order to support DatePicker, ComboBox and any other editing control that opens a Popup.28. Double-click required on external Buttons when in editing mode
A single click on Buttons (or any other control that handles MouseLeftButtonDown) outside of the DataGrid will now register correctly. Previously, if the user was in editing mode, the first click would CommitEdit and the second click would register on the Button.29. Sorting or resetting the ItemsSource does not raise UnloadingRow events
30. Contents of columns out of view do not always show up when the DataGrid is resized such that they are brought into view
Installation Instructions
Visit the Silverlight 2 DataGrid December 2008 Release download page and read the installation instructions carefully. In order to successfully use the new DataGrid you must do the following.
1. Close all instances of Microsoft Visual Studio.2. Delete all cached toolbox items by removing all files beginning with "toolbox" from %LocalAppData%\Microsoft\VisualStudio\9.0.- On Microsoft Windows XP, %LocalAppData% is Documents and Settings\UserName\Local Settings\Application Data.
- On Microsoft Windows Vista, %LocalAppData% is Users\UserName\AppData\Local.
3. Replace the following assemblies with the ones in this package:4. For any existing projects, delete the reference to System.Windows.Controls.Data.dll and then re-add the reference.
Happy Holidays from the Silverlight DataGrid Team!
party42
Participant
1150 Points
351 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Dec 20, 2008 07:54 AM | LINK
Does this release also enable mouseover states for single cells (change foreground color for labels inside cells on mouseover).
edit: good job btw [:)]
Nathan Brouwer
http://www.nathanbrouwer.nl
xsirxx
Member
30 Points
56 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Dec 20, 2008 11:20 PM | LINK
"15. HorizontalContentAlignment does not have any effect on the DataGridColumnHeader"
YES! I have been waiting for that one, should fix alot of the dynamic resizing now... Now I hafta remove my DataView I made to replace DataGrid. Thanks alot for the update, it was much needed here!
yifung
Contributor
3937 Points
637 Posts
Microsoft
Re: Silverlight 2 DataGrid December 2008 Release
Dec 23, 2008 07:12 PM | LINK
The MouseOver, Selected, and Current states on the DataGridCell should be working. Please let us know if you find otherwise. Previously there was a bug where the cell's Background could not be styled, but that was fixed in our mini release.
rtalwalkar
Member
4 Points
12 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Dec 27, 2008 01:57 PM | LINK
yifung
Contributor
3937 Points
637 Posts
Microsoft
Re: Silverlight 2 DataGrid December 2008 Release
Dec 29, 2008 05:24 PM | LINK
The short answer is it'll happen automatically.
The DataGrid is not part of the Silverlight core package. You got the original dll from the SDK and compiled your app with it. Everything in your app that's not part of the core assemblies is packaged into a xap (including the DataGrid dll) file. That xap file is downloaded by any user viewing your Silverlight page. As a result, as long as you build your app with the new DataGrid dll's, your customers will be using the new version as well.
rtalwalkar
Member
4 Points
12 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Dec 30, 2008 12:52 PM | LINK
WilcoBl8
Member
6 Points
3 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Dec 31, 2008 04:17 PM | LINK
Great thanks! Any idea when there will be datagrid which will support paging?
yifung
Contributor
3937 Points
637 Posts
Microsoft
Re: Silverlight 2 DataGrid December 2008 Release
Dec 31, 2008 05:10 PM | LINK
There isn't a concrete date yet but pieces like a pageable data source are being worked on. It is a scenario we will enable in the future
a2005
Member
49 Points
42 Posts
Re: Silverlight 2 DataGrid December 2008 Release
Jan 01, 2009 06:23 AM | LINK