Issue with MonthViewSettings.InlineItemTemplate Displaying

Hello,

I'm having trouble getting the MonthViewSettings.InlineItemTemplate to display the correct size of my button. Every time I add some Corner Radius to my Button, the Button get cut in half instead of just adding the border.

Without CornerRadius Example:
noborder.PNG


With CornerRadius Example

withborder.PNG


Here is my code for the Calendar:

  <syncfusion:SfCalendar x:Name="calendar"
                                   SelectionMode="SingleSelection"
                                   InlineViewMode="Agenda"
                                   ViewMode="MonthView"
                                   ShowInlineEvents="True"
                                   DataSource="{Binding CalendarInlineEvents}"
                                   MaximumEventIndicatorCount="5">
                <syncfusion:SfCalendar.MonthViewSettings >
                    <syncfusion:MonthViewSettings InlineItemTemplate="{StaticResource TemplateSelector}" />
                </syncfusion:SfCalendar.MonthViewSettings>
                <syncfusion:SfCalendar.BindingContext>
                    <local:AppointmentsViewModel/>
                </syncfusion:SfCalendar.BindingContext>
            </syncfusion:SfCalendar>




Here is the code for TemplateSelector:


<Button xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        x:Class="App2.UI.CustomComponents.AppointmentTemplate"
        HorizontalOptions="FillAndExpand"
        VerticalOptions="FillAndExpand"
        BackgroundColor="{Binding Color}"
        Text="{Binding Subject}"
        FontAttributes="Bold"
        CornerRadius="20"
        TextColor="White" >
</Button>

1 Reply 1 reply marked as answer

SS SaiGanesh Sakthivel Syncfusion Team March 16, 2022 02:42 PM UTC

Hi Mario, 
 
#Regarding setting the corner radius for button inside the InlineTemplate 
We suggest you place the button inside the Grid layout to overcome the reported scenario in the sample level. Please refer to the following code snippet for your reference. 
 
Code snippet 
<calendar:SfCalendar x:Name="calendar" 
                        DataSource="{Binding Appointments}" 
                        ShowInlineEvents="true" 
                        InlineViewMode="Agenda"> 
    <calendar:SfCalendar.MonthViewSettings> 
        <calendar:MonthViewSettings AgendaSelectedDateColor="#889e81"> 
            <calendar:MonthViewSettings.InlineItemTemplate> 
                <DataTemplate> 
                    <Grid Padding="0,0,0,5"> 
                    <Button BackgroundColor="Purple" CornerRadius="20" Text="{Binding Subject}" TextColor="White" /> 
                    </Grid> 
                </DataTemplate> 
            </calendar:MonthViewSettings.InlineItemTemplate> 
        </calendar:MonthViewSettings> 
    </calendar:SfCalendar.MonthViewSettings> 
</calendar:SfCalendar> 
 
Please refer to the tested sample in the following locations. 
 
Please let us know if you have any concerns. 
 
Regards,
SaiGanesh Sakthivel


Marked as answer
Loader.
Up arrow icon