Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

how to make the datagrid row height shrink back.. RSS

1 reply

Last post Oct 26, 2009 12:46 PM by jigs_jignesh

(0)
  • rich_r26

    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

    jigs_jignesh

    Member

    182 Points

    42 Posts

    Re: how to make the datagrid row height shrink back..

    Oct 26, 2009 12:46 PM | LINK

    Thanks,
    Jignesh
    Please mark the replies as answers if they answered your question.