SchedulerAgendaView.MonthHeaderTemplate does not show up in Release mode or on a physical device

I have the following xaml for a scheduler in Agenda view:


ColumnDefinitions="50,*">


Grid.Row="0"

Grid.Column="1"

BackgroundColor="Beige"

HorizontalOptions="StartAndExpand"

VerticalOptions="Center"

TextColor="{AppThemeBinding Light=Black, Dark=Black}"

FontSize="16"

FontFamily="PoppinsSemibold"

Text="{Binding StringFormat='{0:MMMM yyyy}'}" />

Grid.Row="1"

Grid.Column="0"

Grid.ColumnSpan="2"

Style="{StaticResource SeparatorStyle}"

HeightRequest="1"/>


This works fine in Debug but the label does not show up in Release mode or on a physical device, only the Boxview (a single line to create a seprator shows up). I've also tried with just a label in a Grid and still the same result, the text only shows up in Debug mode.

Tested using Android Api 33 on a Pixel 5 and Pixel 6 Pro and a physical

This doesn't occur on the Pixel 6 either, only Pixel 6 Pro, could not replicate on iOS.


3 Replies

VM Vidyalakshmi Mani Syncfusion Team August 22, 2023 01:34 PM UTC

Hi Shaun,


Based on the information provided, we have reviewed your query. We found that the specified height for the grid row is not sufficient to display the Box View. Additionally, the HeightRequest given for the Box View was insufficient, hence it was not displayed. We've modified the code you provided, created a simple sample, and it’s working fine in both debug and release modes. Please see the attached sample and the output screenshot for your reference. Please refer to the following code snippet for the changes made:


Code Snippet:

<scheduler:SchedulerAgendaView.MonthHeaderTemplate>

     <DataTemplate>

          <Grid RowDefinitions="49,50"

                ColumnDefinitions="50,*">

                <Label/>

                <BoxView

                       Grid.Row="1"

                       Grid.Column="0"

                       Grid.ColumnSpan="2"                    

                       HeightRequest="50" />

           </Grid>

     </DataTemplate>

</scheduler:SchedulerAgendaView.MonthHeaderTemplate>

 



We hope that this helps you. Please let us know if you need further assistance.




Attachment: MauiSchedulerSampleAndOutputImage_fc3e2840.zip


SH Shaun August 22, 2023 07:53 PM UTC

Hi,


Unfortunately it was the Label that I wanted displayed.

I've even tried 



                        <!-- month header settings template -->
                        <scheduler:SchedulerAgendaView.MonthHeaderTemplate>
                            <DataTemplate>
                            <Grid>
                                <Label x:Name="label"
                                    HorizontalOptions="Center"
                                    TextColor="Black"
                                    FontSize="20"
                                    Background="lightgreen"
                                    VerticalOptions="Center"
                                    Text="{Binding StringFormat='{0:MMMM yyyy}'}" />
                            </Grid>
                        </DataTemplate>
                    </scheduler:SchedulerAgendaView.MonthHeaderTemplate>

Which is pretty much what shows in the Agenda View documentation, works in debug, doesn't work in release mode on android. I can't see how to display the date except by styling the SchedulerAgendaView.MonthHeaderSettings, but then you're stuck with the LightGreen background which doesn't fit the app style.


Any help apprecitated.

Shaun



VM Vidyalakshmi Mani Syncfusion Team August 23, 2023 01:07 PM UTC

Hi Shaun,


We have checked your query based on the provided information and identified that it is an issue at the sample level. We have updated the sample accordingly. Kindly refer to the attached sample and the output screenshot for your reference. Please refer to the following code snippet for the changes made:


Code Snippet:

<scheduler:SchedulerAgendaView.MonthHeaderTemplate>

     <DataTemplate>

          <Grid Background="lightgreen" >

                 <Label x:Name="label"                                   

                        TextColor="Black"

                        FontSize="20"                               

                        Text="{Binding StringFormat='{0:MMMM yyyy}'}"

                        HorizontalOptions="Center"

                        VerticalOptions="Center"/>

            </Grid>

      </DataTemplate>

</scheduler:SchedulerAgendaView.MonthHeaderTemplate>


If the shared information doesn’t meet your requirement, please modify our sample and also provide the issue replicate video, which would be helpful for us to check on it and provide you with the solution as soon as possible.




Attachment: SampleAndScreenshot_50aabafb.zip

Loader.
Up arrow icon