Having a single column datagrid, which has a Control as its row data template. Some of the parts in the control initially are collasped, so the datagrid's row has a smaller height.
After some event causes those collasped parts to be visible, the row's height grows. But after other event causes those parts collasped again, the datagrid's row keeps the prvious height.
Is there a way to make the row also reduce its height alone with those collasped parts? Thanks!
rich_r26
Member
27 Points
102 Posts
how to make the datagrid row height shrink back..
Aug 27, 2009 08:56 PM | LINK
Having a single column datagrid, which has a Control as its row data template. Some of the parts in the control initially are collasped, so the datagrid's row has a smaller height.
After some event causes those collasped parts to be visible, the row's height grows. But after other event causes those parts collasped again, the datagrid's row keeps the prvious height.
Is there a way to make the row also reduce its height alone with those collasped parts? Thanks!
<data:DataGrid x:Name="theGrid" HeadersVisibility="None"
AutoGenerateColumns="False"
IsReadOnly="True" GridLinesVisibility="None"
Height="auto" Width="auto"
VirtualizingStackPanel.VirtualizationMode="Standard"
Background="Transparent"
VerticalAlignment ="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
HorizontalScrollBarVisibility="Disabled"
>
<data:DataGrid.Columns>
<data:DataGridTemplateColumn >
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate >
<Grid Background="Transparent" >
<local:RowControl Background="Transparent" Height="Auto"
VerticalAlignment="Stretch" HorizontalAlignment="Left"
Margin="0,0,0,0" BorderBrush="#FFff0000" Padding=" 3"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" />
</Grid >
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
jigs_jignesh
Member
182 Points
42 Posts
Re: how to make the datagrid row height shrink back..
Oct 26, 2009 12:46 PM | LINK
http://betaforums.silverlight.net/forums/p/47115/303655.aspx
http://forums.silverlight.net/forums/t/71184.aspx
http://blogs.msdn.com/scmorris/archive/2008/06/10/auto-sizing-the-silverlight-datagrid.aspx
Jignesh
Please mark the replies as answers if they answered your question.