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

AgendaItemTemplate not rendering anything complex

We are evaluating the SfSchedule control in Xamarin.Forms but it looks like the Agenda items aren't really that customizable, sure if we put a Button in there or just a plain Label, it renders, but if I have something a bit more complex like this:

    <ContentPage.Resources>
        <ResourceDictionary>
            <DataTemplate x:Key="AgendaItemTemplate">
                <Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label TextColor="Orange" FontSize="Medium" Grid.Column="0" Grid.Row="0" Text="{Binding StartTime, StringFormat='H'}" />
                    <Label TextColor="Black" FontSize="Medium" Grid.Column="1" Grid.Row="0" Text="{Binding Subject}" />
                </Grid>
            </DataTemplate>
        </ResourceDictionary>
    </ContentPage.Resources>
    <schedule:SfSchedule x:Name="scheduler" DataSource="{Binding ScheduleCollection}" ScheduleView="MonthView" OnMonthCellLoadedEvent="SfSchedule_OnOnMonthCellLoadedEvent">
        <schedule:SfSchedule.MonthViewSettings>
            <schedule:MonthViewSettings ShowAgendaView="true" AgendaItemTemplate="{StaticResource AgendaItemTemplate}" />
        </schedule:SfSchedule.MonthViewSettings>
    </schedule:SfSchedule>


It doesn't render anything at all. Am I missing something?

11 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team January 3, 2019 08:43 AM UTC

Hi Winston,  
  
Thanks for contacting Syncfusion support.  
  
We have analyzed the reported issue with “AgendaView Item Template not rendering properly” based on the code you have shared, and it works fine from our side. We have already found and fixed a similar issue and it was included in our last release. Kindly update to our latest version and check the same. 
  
Please find the link to download our latest version  
 
 
We have prepared sample for the same.  
 
Sample: Schedule  
 
If the issue remains same even after the update, kindly modify the sample and revert us with more details and replication procedure, it will be helpful for us to give you a better solution.  
 
Regards,
Subburaj Pandian V 



SM Smokeball January 3, 2019 10:13 AM UTC

Thank you for your reply. You're right it's fixed and works in the latest one, however there's one problem, it seems it doesn't increase automatically the height of the row item if one of the subject is very long, how do we fix this?

I've attached a screenshot

Attachment: not_expanding_358f3546.zip


SP Subburaj Pandian Veluchamy Syncfusion Team January 4, 2019 10:25 AM UTC

Hi Winston, 
 
Thanks for the update. 
 
As of now, we don’t have support to customize the AgendaView row height in Schedule Xamarin Forms. We have already considered to implement this feature and logged feature report for the same. In the feature, we have considered the following cases, 
 
·       Support that allows user to set a static height for agenda view row, that will be applicable for all the rows in agenda view. 
·       Support that allows user to change a single row height only in agenda view, so agenda view can have uneven rows. 
 
We will implement this feature in any of our upcoming release and let you know once it has been rolled out. 
 
Regards,
Subburaj Pandian V 



AM Amir February 6, 2019 02:43 PM UTC

Is there a way we can match items to the agenda row height, as my items don't currently fill to the height of each row on android



SP Subburaj Pandian Veluchamy Syncfusion Team February 7, 2019 11:35 AM UTC

Hi Amir, 
 
We have checked the reported issue with Schedule “Agenda View items not rendered based on its default height” in Xamarin Forms (Android) and it is working fine as expected from our side. 
 
We have prepared sample for the same, please find the sample by the following link, 
 
 
Kindly check the sample, if the sample doesn’t meet your scenario / requirement, kindly revert us by modifying the sample based on your scenario to reproduce the issue. Which helps us to analyze on it and provide you the solution. 
 
Regards,
Subburaj Pandian V  



BE Bernard April 20, 2020 08:07 PM UTC

Hello,

I am currently running on version 18.1.0.44 of SfSchedule an I've encountered some problems when using templates.
The following are the issues I noticed:
     1. The template can now only be set for the area to the right of the date in the Agenda view area
     2. The 'left' date can not be overwritten
     3. The following code has different issues on ios and android:

<Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="AliceBlue">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="5" />
                        <ColumnDefinition Width="0.2*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="5" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <BoxView BackgroundColor="{Binding Color}"  Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"
                             VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
                    <Label TextColor="Orange" FontSize="Medium" Grid.Column="1" Grid.Row="0" Text="{Binding StartTime, StringFormat='{0:hh}'}" 
                           HorizontalOptions="Fill" VerticalOptions="Fill"/>
                    <Label TextColor="Black"  FontSize="Medium" Grid.Column="2" Grid.Row="0" Text="{Binding Subject}" 
                           HorizontalOptions="Fill" VerticalOptions="Fill"/>           
                    <BoxView BackgroundColor="{Binding Color}"  Grid.Column="3" Grid.Row="0" Grid.RowSpan="2"
                             VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
 </Grid>

The above creates 2 columns with <ColumnDefinition Width="5" />  to display colored boxviews.

Both on Android and ios, the left column is ok but the right on is being ignored or hidden. 
Lastly, on ios it also makes the template horizontally scrollable.

I attached your sample with the above changes so you can have a look.

Let me know if you have any questions,
Bernard 

Attachment: Schedule_Appointment_Sample_20200420_4ece1347.zip


MS Muniappan Subramanian Syncfusion Team April 21, 2020 09:30 AM UTC

Hi Bernard, 
 
Thank you for using Syncfusion products. 
 
Query 1: The 'left' date cannot be overwritten 
We have checked your query and we regret that as of now Schedule doesn’t have support to customize the left size date area in Agenda View. 
 
Query 2: Right side of Template was hidden 
we have already found and fixed the issue and it will be included in our upcoming Volume 1 SP1 release which is expected to roll out on the month of May 2020. We appreciate your patience until then.  
 
We hope this helps. Please let if you if you have any concern.  
 
Regards,   
Muniappan S       



BE Bernard April 21, 2020 02:18 PM UTC

Hi there,

Thanks for fixing 'Query 2: Right side of Template was hidden'. I look forward to it.

As for query 1, any plans for when this will be available again? 
There are good reasons to allow full horizontal template control by taking away the date on the left:
  • Its not so logical to show the date both in the calendar view and in the Agenda view
  • Other calendars don't show the date again but do show the times (more relevant in fact)
  • The current setup takes up a lot of screen space vertically
  • Allow developers to fully customize as they see fit
  • If the developers truly want a date on the left, he can do so by showing only in the first item and hiding it in the next items. Would this not create the same effect as you intend?
In fact, the way you had it before allowed for full horizontal customization. You had a date on top and the developer had full horizontal customization freedom.
Maybe you can set a flag that allows the following:
  • Show date on top (as you had before) 
  • No date shown
  • Show date in the left column (not really needed I think)
Let me know,
Bernard


MS Muniappan Subramanian Syncfusion Team April 22, 2020 09:21 AM UTC

Hi Bernard, 
 
Thank you for the update. 
 
Query: The 'left' date cannot be overwritten  
 
Based on the shared details we have checked your requirement.  You can achieve your requirement by using custom ListView. Please refer our following KB document to show month view appointments in custom ListView, 
 
  
We hope this helps. Please let if you if you have any concern. 
 
Regards,    
Muniappan S.   



BE Bernard April 22, 2020 02:17 PM UTC

Yes of course... :)
Basically, if a more custom approach is needed, don't use the build in AgendaView but create your own using ListView that interacts with the sfschedule. 
All clear, thanks! 


MS Muniappan Subramanian Syncfusion Team April 23, 2020 11:06 AM UTC

Hi Bernard, 
 
Thank you for the update. 
 
We are glad that our solution meets your requirement. Please let us know if you need any further update. As always, we are happy to help you out. 
 
Regards, 
Muniappan S. 


Loader.
Live Chat Icon For mobile
Up arrow icon