Set HeaderHeight to be Auto(Height)

Hi:

I have SfPopupLayout with <PopupView.HeaderTemplate>

                   <sfPopup:PopupView

                     x:Name="MainPopupView"

                     AnimationMode="SlideOnBottom"

                     ShowCloseButton="True"

                     ShowFooter="False"

HeaderHeight="???????" 

                     BackgroundColor="LightGray"

                     Margin="10,0,10,0">

                   <sfPopup:PopupView.HeaderTemplate>

                     <sfPopup:PopupView.HeaderTemplate>

                        <DataTemplate>

                            <ViewCell>

                                <StackLayout

                                    HorizontalOptions="FillAndExpand"

                                    BackgroundColor="White">

                                    <Grid

                                        HorizontalOptions="Start">

                                        <Grid.RowDefinitions>

                                            <RowDefinition Height=“Auto”/>

                                            <RowDefinition Height=“20”/>

                                        </Grid.RowDefinitions>

                                        <Grid.ColumnDefinitions>

                                            <ColumnDefinition Width=“*”/>  

                                            <ColumnDefinition Width=“90”/>

                                        </Grid.ColumnDefinitions>

                                        <StackLayout

                                            Grid.Row="0"

                                            Grid.Column="0"

                                            Grid.ColumnSpan=“2”

                                            VerticalOptions="StartAndExpand"

                                            Spacing="0">

                                            <Label

                                                Text=“Line #1 Long Text is here”

                                                FontAttributes="Bold"

                                                LineBreakMode="CharacterWrap"

                                                BackgroundColor="Transparent"

                                                FontSize="12"

                                                TextColor="Black"

                                                HorizontalOptions="StartAndExpand"

                                                VerticalOptions="StartAndExpand">

                                            </Label>

                                        </StackLayout>

                                        <Label

                                            Grid.Row="1"

                                            Grid.Column="0"

                                            Grid.ColumnSpan="1"

                                            Text=“Line #2 " 

                                            FontAttributes="None"

                                            BackgroundColor="Transparent"

                                            FontSize="12"

                                            TextColor="Black"

                                            HorizontalOptions="Start"

                                            HorizontalTextAlignment="Start"

                                            VerticalTextAlignment="Center"

                                            IsVisible="True">

                                        </Label>

                            </ViewCell>

                        </DataTemplate>

                     </sfPopup:PopupView.HeaderTemplate>

I would like to set Row 0 to be Auto - this row  of Stacklayout will automatically auto-height. But how can set the HeaderHeight of Popview to have the header to be auto size - when Stacklayout's height is bigger? 


Thank you

Nick


1 Reply

SV Suja Venkatesan Syncfusion Team January 17, 2022 02:25 PM UTC

Hi Nick, 

We suspect your requirement is to display the SfPopupview header with height based on the content in headertemplate. Currently, we didn’t have direct support for setting HeaderHeight as auto. We need to set height explicitly to the property HeaderHeight with integer value as like below code snippet. 

<sfPopup:SfPopupLayout.PopupView> 
                    <sfPopup:PopupView x:Name="MainPopupView" 
                     AnimationMode="SlideOnBottom" 
                     ShowCloseButton="True" 
                     HeaderHeight="200" 
                     ShowFooter="False" 
                     BackgroundColor="LightGray" 
                     Margin="10,0,10,0"> 
 

Please revert to us with more details with illustration video or image if we have misunderstood your requirement. It will be more helpful for us to provide the prompt solution at earlier from our end. 

Regards, 
Suja 


Loader.
Up arrow icon