We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Many popup in same page

Hello I have a page with 3 buttons and I'd like each button to display a different popup ... its 3 popup defined on the same page ... How to do that ? I searched the Documentation without success.
Thanks

7 Replies

MK Muthu Kumaran Gnanavinayagam Syncfusion Team February 3, 2020 12:58 PM UTC

Hi Emmanuel, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Need to show 3 different popups in a single page” from our side. We would like to let you know that you can create and show any number of popups in a page. You could initialize the number of instances required and in a button clicked action you can display popup by calling the SfPopupLayout.Show method. 
 
For your reference, we have attached the working sample and you can download it from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu kumaran.  



EC Emmanuel Cesaire FOKO February 4, 2020 03:44 PM UTC

Merci pour la réponse rapide ... en fait j'aimerais le faire en XAML pas dans le code derrière ... est-ce possible? 


KK Karthikraja Kalaimani Syncfusion Team February 5, 2020 01:24 PM UTC

Hi Emmanuel,

Thank you for the update.

We have prepared a sample a four requirement and in our sample we initialized multiple popup in XAML. For more details please refer to the below code example and sample.

Code Example,
 
<sfPopup:SfPopupLayout x:Name="popup1"> 
                <sfPopup:SfPopupLayout.PopupView> 
                    <sfPopup:PopupView> 
                        <sfPopup:PopupView.ContentTemplate> 
                        <DataTemplate> 
                            <Label Text="This is Popup1"></Label> 
                        </DataTemplate> 
                        </sfPopup:PopupView.ContentTemplate> 
                    </sfPopup:PopupView> 
                </sfPopup:SfPopupLayout.PopupView> 
            </sfPopup:SfPopupLayout> 
            <sfPopup:SfPopupLayout x:Name="popup2"> 
                <sfPopup:SfPopupLayout.PopupView> 
                    <sfPopup:PopupView> 
                        <sfPopup:PopupView.ContentTemplate> 
                            <DataTemplate> 
                                <Label Text="This is Popup2"></Label> 
                            </DataTemplate> 
                        </sfPopup:PopupView.ContentTemplate> 
                    </sfPopup:PopupView> 
                </sfPopup:SfPopupLayout.PopupView> 
            </sfPopup:SfPopupLayout> 
            <sfPopup:SfPopupLayout x:Name="popup3"> 
                <sfPopup:SfPopupLayout.PopupView> 
                    <sfPopup:PopupView> 
                        <sfPopup:PopupView.ContentTemplate> 
                            <DataTemplate> 
                                <Label Text="This is Popup3"></Label> 
                            </DataTemplate> 
                        </sfPopup:PopupView.ContentTemplate> 
                    </sfPopup:PopupView> 
                </sfPopup:SfPopupLayout.PopupView> 
            </sfPopup:SfPopupLayout> 

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Popup_Demo_151137831638164.zip

Regards,
Karthik Raja



SH Sharma July 17, 2022 02:27 AM UTC

Hello,

Both examples given here are for 'Displaying popup on the go' which does not support 

popupLayout.ShowAtTouchPoint();

So It seems like 'Multiple popups' and showing pop up at touch points are not possible.

Is this true?

I am stuck please help.

Thanks,

Anand



SV Suja Venkatesan Syncfusion Team July 18, 2022 01:13 PM UTC

Hi Sharma,

Regarding “Both examples given here are for 'Displaying popup on the go' which does not support popupLayout.ShowAtTouchPoint()“

 

Yes, ShowAtTouchPoint is not supported when  Displaying popup on the fly. We have mentioned in our user guidelines documentation as note under position popup at touch point topic.

 

UG link: https://help.syncfusion.com/xamarin/popup/popup-positioning#position-popup-at-touch-point

 

Regarding “'Multiple popups' and showing pop up at touch points are not possible.

Is this true

You can achieve your requirement ”Displaying multiple popup in single page” as like below code snippet.

 

Code snippet:

XAML:

  <Grid>

            <Grid.RowDefinitions>

                <RowDefinition Height="300"/>

                <RowDefinition Height="300"/>

            </Grid.RowDefinitions>

            <sfPopup:SfPopupLayout Grid.Row="0" x:Name="popupLayout">

            <sfPopup:SfPopupLayout.Content>

                <StackLayout x:Name="layout">

                    <Button x:Name="clickToShowPopup" Text="ClickToShowPopup"

               VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="ClickToShowPopup_Clicked" />

                </StackLayout>

            </sfPopup:SfPopupLayout.Content>

            <sfPopup:SfPopupLayout.PopupView>

                <sfPopup:PopupView>

                    <sfPopup:PopupView.ContentTemplate>

                        <DataTemplate>

                            <Label Text="This is Popup1"></Label>

                        </DataTemplate>

                    </sfPopup:PopupView.ContentTemplate>

                </sfPopup:PopupView>

            </sfPopup:SfPopupLayout.PopupView>

        </sfPopup:SfPopupLayout>

            <sfPopup:SfPopupLayout Grid.Row="1" x:Name="popupLayout1">

                <sfPopup:SfPopupLayout.Content>

                    <StackLayout x:Name="layout1">

                        <Button x:Name="clickToShowPopup1" Text="ClickToShowPopup"

               VerticalOptions="Start" HorizontalOptions="FillAndExpand" Clicked="clickToShowPopup_Clicked_1" />

                    </StackLayout>

                </sfPopup:SfPopupLayout.Content>

                <sfPopup:SfPopupLayout.PopupView>

                    <sfPopup:PopupView>

                        <sfPopup:PopupView.ContentTemplate>

                            <DataTemplate>

                                <Label Text="This is Popup1"></Label>

                            </DataTemplate>

                        </sfPopup:PopupView.ContentTemplate>

                    </sfPopup:PopupView>

                </sfPopup:SfPopupLayout.PopupView>

            </sfPopup:SfPopupLayout>

        </Grid>

 

C#

        private void ClickToShowPopup_Clicked(object sender, EventArgs e)

        {

            // Shows SfPopupLayout at the touch point.

            popupLayout.ShowAtTouchPoint();

        }

 

        private void clickToShowPopup_Clicked_1(object sender, EventArgs e)

        {

            popupLayout1.ShowAtTouchPoint();

        }

 

We have attached a runnable sample based on your requirement for your reference. Please have a look at this sample and revert to us with more details about requirement with illustration image or video if we misunderstood your requirement.

 


Regards,

Suja


Attachment: GettingStarted_d900f76e.zip


SH Sharma replied to Suja Venkatesan August 7, 2022 07:47 AM UTC

Thank you. I will look into it.



SV Suja Venkatesan Syncfusion Team August 8, 2022 12:45 PM UTC

Hi Sharma,


Let us know if you require further assistance , will be happy to assist you.


Regards,

Suja


Loader.
Live Chat Icon For mobile
Up arrow icon