Expander with SF Datagrid does resize to content

I have Stack layout that containing Expander with expander content having SFDatagrid

i.e <syncfusion:SfExpander.Content> . Silimar to getstarted article

Getting Started with .NET MAUI Expander control | Syncfusion

Expander is not resizing to content of SFDatagrids . I tried to use VerticalOptions to Fill or Fillandexpand. When content for SFDatagrid increases it showing scrollbar within grid. How to auto resize expander?


Also is it possible to set expander height to certain percent of the   Stack layout Height ?


thanks

Praveen






3 Replies

KK Kamala Kannan Sakthivel Syncfusion Team August 29, 2024 02:53 PM UTC

Hi Praveen D,

We have analyzed the reported issue , we suspect that content of SfExpander doesnot returns the proper height , consequently affecting the proper layout of the SfDataGrid. To address this, we recommend setting the HeightRequest  for the SfDataGrid inside the content template. We have attached the code snippet for your reference.

 

   <syncfusion:SfExpander  x:Name="expander" >

         <syncfusion:SfExpander.Header>

              <Grid HeightRequest="45">

                  <Label CharacterSpacing="0.25" FontSize="16"  FontFamily="Roboto-Regular"  Text="SfExpander"   VerticalOptions="CenterAndExpand"/>

             </Grid>

         </syncfusion:SfExpander.Header>

                

         <syncfusion:SfExpander.Content>

                              

               <Grid x:Name="grid">

                   <datagrid:SfDataGrid x:Name="dataGrid" HeightRequest="700"

                          ItemsSource="{Binding OrderInfoCollection}">

                    


Regards,
KamalaKannan S.



PD Praveen D August 29, 2024 11:07 PM UTC

Thanks I was able to use the suggestion.



JS Jayashree Suresh Anand Syncfusion Team August 30, 2024 05:53 AM UTC

Hi Praveen D, 

We are pleased that our suggestion was helpful to you. Should you require any further assistance, please do not hesitate to contact us. Additionally, you are welcome to start a new forum thread should any new issues arise.

Regards,

Jayashree 




Loader.
Up arrow icon