This question is locked. New answers and comments are not allowed.
I am embedding a Silverlight control in a SharePoint web part, and the layout container that the GridView is contained within has Height="Auto", the grid is not sizing to the full height of its contents. Can anyone suggest what I might be doing wrong here?
Here is the XAML code for the user control:
Of course, if I give the plugin a fixed height, the control displays with that height. However, what I want is for the silverlight control to stretch to the full height of its contents. For example, if each grid row has a height of 25px and I databind 10 items, the grid's layout container should stretch to accomodate the full height of the grid (250px + header/footer, etc). If I pass in 100% for the plugin height, the control won't display at all. Any ideas?
Thanks in advance for your help,
Mike
Here is the XAML code for the user control:
<UserControl.Resources> <Style x:Key="LabelText" TargetType="TextBlock"> <Setter Property="FontFamily" Value="Verdana" /> <Setter Property="FontSize" Value="12" /> <Setter Property="Foreground" Value="#333333" /> <Setter Property="TextWrapping" Value="Wrap" /> </Style> <Style x:Key="HeaderText" TargetType="TextBlock"> <Setter Property="FontFamily" Value="Verdana" /> <Setter Property="FontSize" Value="13" /> <Setter Property="Foreground" Value="White" /> <Setter Property="TextWrapping" Value="Wrap" /> <Setter Property="FontWeight" Value="Bold" /> </Style> <Style x:Key="LinkText" TargetType="HyperlinkButton"> <Setter Property="FontFamily" Value="Verdana" /> <Setter Property="FontSize" Value="12" /> <Setter Property="Foreground" Value="#7d2613" /> </Style> <SolidColorBrush x:Key="PanelHeaderInnerBorder" Color="#FFA4624F" /> <LinearGradientBrush x:Key="PanelHeaderBackground" EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFAB6752" /> <GradientStop Color="#FF6F1807" Offset="1"/> </LinearGradientBrush> <SolidColorBrush x:Key="PanelHeaderOuterBorder" Color="#FF561707" /></UserControl.Resources><Grid x:Name="LayoutRoot" Width="Auto" Height="Auto"> <Grid.Resources> <local:MailToLinkConverter x:Key="EmailLinkConverter"></local:MailToLinkConverter> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Border BorderBrush="{StaticResource PanelHeaderOuterBorder}" Grid.Row="0" CornerRadius="4,4,0,0" Background="{StaticResource PanelHeaderBackground}"> <Border BorderBrush="{StaticResource PanelHeaderInnerBorder}" Padding="5,3" CornerRadius="4,4,0,0"> <TextBlock x:Name="ListHeader" Style="{StaticResource HeaderText}" Text="Team Members"></TextBlock> </Border> </Border> <telerik:RadDataPager telerikControls:StyleManager.Theme="Summer" Grid.Row="1" x:Name="ResultsPager" PageSize="10" Source="{Binding Items, ElementName=ResultsGrid}" DisplayMode="PreviousNextNumeric" AutoEllipsisMode="Both" NumericButtonCount="5" IsTotalItemCountFixed="True" Visibility="Collapsed" /> <telerik:RadGridView telerikControls:StyleManager.Theme="Summer" RowIndicatorVisibility="Collapsed" HorizontalAlignment="Stretch" Name="ResultsGrid" VerticalAlignment="Stretch" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" EditTriggers="None" GridLinesVisibility="None" IsFilteringAllowed="False" ShowGroupPanel="False" Grid.Row="2" AutoGenerateColumns="False" ShowColumnHeaders="False" CanUserSelect="False" RowStyle="{StaticResource GridViewRowStyle}" Width="Auto" Height="Auto"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn UniqueName="EmployeeDetails" Header="Details" DataMemberBinding="{Binding Name}" Width="*" Background="White"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition MinHeight="70"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="56"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <StackPanel Orientation="Vertical" Grid.Column="0"> <Border BorderBrush="#666666" BorderThickness="1" Padding="1"> <HyperlinkButton x:Name="ProfileLink" NavigateUri="{Binding ProfileUrl}" TargetName="_blank" ToolTipService.ToolTip="Browse to profile page"> <HyperlinkButton.Content> <Image Stretch="Uniform" Width="52" Height="52" Source="{Binding PictureUrl}" /> </HyperlinkButton.Content> </HyperlinkButton> </Border> <HyperlinkButton x:Name="DetailsLink" Style="{StaticResource LinkText}" Content="Details" Click="DetailsLink_Click" Visibility="Collapsed"></HyperlinkButton> </StackPanel> <StackPanel Orientation="Vertical" Grid.Column="1" Margin="4,6"> <TextBlock FontWeight="Bold" Style="{StaticResource LabelText}" Text="{Binding Name}" /> <TextBlock Style="{StaticResource LabelText}" Text="{Binding JobTitle}" /> <HyperlinkButton x:Name="EmailLink" Style="{StaticResource LinkText}" FontSize="11" Content="{Binding Email}" NavigateUri="{Binding Email, Converter={StaticResource EmailLinkConverter}}" TargetName="_blank"></HyperlinkButton> </StackPanel> </Grid> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid>Of course, if I give the plugin a fixed height, the control displays with that height. However, what I want is for the silverlight control to stretch to the full height of its contents. For example, if each grid row has a height of 25px and I databind 10 items, the grid's layout container should stretch to accomodate the full height of the grid (250px + header/footer, etc). If I pass in 100% for the plugin height, the control won't display at all. Any ideas?
Thanks in advance for your help,
Mike