I've got a DataGrid in a Silverlight application with data in it. There's also a button on our app that can change the layout such that the DataGrid changes width.
The problem is when you are in the "small" mode and scroll around, for columns that you can't see, their DataGridCell elements get Visibility=Collapsed. Now this is fine when you are scrolling around, but when the size of the DataGrid increases to show all columns, they stay collapsed. However for some reason you can always see all the cells in the first row.
This smells like a bug in the DataGrid control. Does anyone know a way to work around it? I've got as far as adding a handler for SizeChanged on the DataGrid, but I'm not quite sure what to call to force it to show those collapsed cells.
EDIT: After some testing I've found that it only happens with GridLinesVisibility="Horizontal"
XAML (Clicking toggles width of DataGrid from half to full):
<StackPanel Orientation="Vertical">
<data:DataGrid x:Name="testDataGrid" GridLinesVisibility="Horizontal" />
<Button HorizontalAlignment="Center" Content="Switch Width" Name="switchWidthButton" Click="Button_Click" />
</StackPanel>
Update: Though it can still happen sometimes with GridLinesVisibilty
not set. I have not worked out exactly what circumstances this happens under.