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

SfAccording doesn't render if the container is not visible at page creation

Hi,
I'm using the SfAccordion in a StackLayout. The Stacklayout is set IsVisible={Binding Show} to either visible or invisble.
If the boolean is false and the StackLayout visible on the ContentPage generation, the SfAccordion is not rendered when toggle the boolean to true.

If I switch to a different page and return, while the boolean "Show" is true, the SfAccordion renders eventually.
Please see the screenshots attached.

Thank you for looking into this.

Attachment: screenshots_77365eef.zip

7 Replies 1 reply marked as answer

SS SaiGanesh Sakthivel Syncfusion Team April 26, 2021 01:00 PM UTC

Hi Andreas, 
 
Thank you for using syncfusion support. 
 
#Regarding SfAccording doesn't render if the container is not visible at page creation 
We have checked the reported query from our end. we suggest to you to set the Horizontal and Vertical orientation options as Fill and Expand for a stackLayout. Let us know if you still facing the same issue? please share the following details which will be help us to check on it and provide you the solution as soon as possible 
  
·       Share the xaml code snippet used in sample. 
·       Share the issue replicate video or steps.  
·       Share the issue replicate platforms  
·       Share the issue replicate device configuration 
·       Share the syncfusion version used in the sample.   
   
Regards,
SaiGanesh Sakthivel
 



AR Andreas Reitberger April 26, 2021 02:46 PM UTC

Hello SaiGanesh Sakthivel,

thank you for your reply. I tried to set the StackLayout to FillAndExpand as suggestet.
However this haven't solved the problem.

Please find the needed information below. I also attached the XAML code used.

Share the xaml code snippet used in sample.
Please find it attached.

Share the issue replicate video or steps. 
Video: https://drive.google.com/file/d/1IRu0DCOJ6xLEZHypATPkH-2r4MA5EFJS/view?usp=sharing
- Create a ContentPage and create following hirachy

<ContentPage.Content>
<Grid>
<ScrollView>
<StackLayout>
  <!-- Lot of Elements, so the example code is on bottom and the user needs to scroll down to see the example code -->
  <!-- Insert content of code example -->
</StackLayout>
</ScrollView>
</Grid>
<ContentPage.Content>

- Make a button to toggle the property to true/false.
- The boolean for the "IsVisible" property of the StackLayout needs to be "false" on startup
- Visit the page and toggle the button so that the value is true
- See that the Accordion is not rendered
- Visist another page and return to the main page while the "IsVisible" property is set true
- Accordion renders

Share the issue replicate platforms 
- Tested on iOS 14 with the simulator (SE 2020) and Iphone 11 (real device)
- Not tested on Android 

Share the issue replicate device configuration
- Nothing special, running iOS 14

Share the syncfusion version used in the sample.  
19.1.0.57

Hope this helps!
Thank you!


Attachment: example_fa5835ff.zip


SS SaiGanesh Sakthivel Syncfusion Team April 28, 2021 03:44 AM UTC

Hi Andreas, 
 
Thank you for the update. 
 
#Regarding SfAccording doesn't render if the container is not visible at page creation 
Currently, we are validating the reported scenario and we will update the further details on or before the April 29,2021. We appreciate your patience until then. 
 
Regards, 
SaiGanesh Sakthivel 



SS SaiGanesh Sakthivel Syncfusion Team April 30, 2021 03:24 AM UTC

Hi Andreas,  
  
Thank you for the update.  
  
#Regarding SfAccording doesn't render if the container is not visible at page creation  
Currently, we are checking the reported scenario with our development team and we will update the further details on or before the May 3,2021. We appreciate your patience until then.  
  
Regards,  
SaiGanesh Sakthivel 



LN Lakshmi Natarajan Syncfusion Team May 4, 2021 09:54 AM UTC

Hi Andreas, 
 
Sorry for the delay caused. 
 
We have checked the shared code snippets and we have prepared a sample for the same. We would like to inform you that when adding the template control inside StackLayout or Grid with Height as Auto, the child element will not get the height. And, the SfAccordion is entirely a template based content we cannot determine default height value to the control. So we suggest you to provide  HorizontalOptions and VerticalOptions as FillAndExpand options for the parent element.  
 
Please refer to the following code snippets to achieve your requirement, 
 
XAML: Set HorizontalOptions and VerticalOptions for SfCardView. Also, load the SfAccordion in the Grid. 
<StackLayout x:Name="parentStack" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="False" Spacing="12" BackgroundColor="Red"> 
    <!--  HeightRequest="{OnIdiom Tablet=280,Default=250}" --> 
    <!-- Filament --> 
    <cards:SfCardView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> 
        <Grid  Margin="8" > 
           … 
            <!-- Content --> 
            <Grid 
Grid.Row="1" 
Grid.Column="1" 
Grid.ColumnSpan="3" 
> 
                <expander:SfAccordion 
DynamicSizeMode="Content"  
AutoScrollPosition="MakeVisible" 
ExpandMode="SingleOrNone" > 
                    <expander:SfAccordion.Items> 
                        <!-- Nozzle Wear --> 
                       … 
                    </expander:SfAccordion.Items> 
                </expander:SfAccordion> 
            </Grid> 
        </Grid> 
    </cards:SfCardView> 
 
</StackLayout> 
 
We have attached the tested sample in the following link, 
 
Please check our sample and let us know if this helps. 
 
Regards, 
Lakshmi Natarajan 


Marked as answer

AR Andreas Reitberger May 5, 2021 03:45 PM UTC

Hi,
thanks for the sample. 
I tried all the things you mentioned, however the behaviour is still the same.

If I set a fix height with "HeightRequested", then it's working, but the card is not auto sizing anymore when 
the SfAccordion is expanded.

Please find the updated code snippet attached.

Attachment: updated_1375ee90.zip


LN Lakshmi Natarajan Syncfusion Team May 7, 2021 04:14 AM UTC

Hi Andreas,

 

Sorry for the inconvenience caused.

 

We have checked the updated code snippets from our side. We would like to inform you that we could not reproduce the issue at our side and the Accordion is visible when changing the visibility of the parent. We have attached the tested sample based on the code snippets and you can download it from the following link,

 

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AccordionXamarin-2108452792

Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/164830_Video929382790

 

Please check our sample and let us know if you still facing the same issue? If not, please modify our sample to reproduce the issue and revert us back which would be helpful for us to check on it and provide you the solution at the earliest.

 

#Regarding the card is not auto sizing anymore when the SfAccordion is expanded

 

We have checked the reported issue with the provided sample, and we would like to inform you that in our SfCardView we have added StackLayout with Horizontal orientation as a root panel for our control structure. We can replicate the same reported problem at our end if we use this panel with Horizontal orientation instead of SfCardView.

 

So, please set the height request as you specified to resolve the reported issue.

 

Regards,

Lakshmi Natarajan

 


Loader.
Up arrow icon