Skip to main content

Microsoft Silverlight

Answered Question DataGrid in ScrollViewerRSS Feed

(0)

Leonid Andruhin
Leonid A...

Member

Member

636 points

137 Posts

DataGrid in ScrollViewer

When datagrid is placed on the page like in sample, it doesn't occupy all place of grid's cell (1, 1) and it(DataGrid) is incompletely drows by Silverlight. In beta 1 all was fine.

<UserControl x:Class="ControlsTest.Page"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"

Loaded="UserControl_Loaded">

<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

<Grid x:Name="LayoutRoot" Background="White">

<Grid.RowDefinitions>

<RowDefinition Height="Auto"/>

<RowDefinition/>

</Grid.RowDefinitions>

<Grid.ColumnDefinitions>

<ColumnDefinition Width="Auto"/>

<ColumnDefinition/>

</Grid.ColumnDefinitions>

<Button x:Name="btn" Content="It's just a button"/>

<TextBlock Text="It's a text block with some text" Grid.Column="1"/>

<data:DataGrid x:Name="dgr" Grid.Row="1" Grid.Column="1"/>

</Grid>

</ScrollViewer>

</UserControl>

snelldl
snelldl

Member

Member

148 points

141 Posts

Re: DataGrid in ScrollViewer

I found that as well - if no data is bound to the datagrid, it doesn't draw anything, not even column headers.

Leonid Andruhin
Leonid A...

Member

Member

636 points

137 Posts

Re: Re: DataGrid in ScrollViewer

No, datagrid drows rectangle, but you can bound to some data in pageLoad or comment ScrollViewer tags - you can see difference

Allen Chen – MSFT
Allen Ch...

Star

Star

13862 points

1,803 Posts

Answered Question

Re: Re: DataGrid in ScrollViewer

Hi:

  Thanks for your reporting. It's a known issue that being worked on.

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities