I want to create a custom InlineView for MonthView inline appointments, and I'd a sample of how to do it. Something like:
<syncfusion:SfSchedule x:Name="Calendar"
Margin="10,0,10,0"
Locale="pt"
ScheduleView="MonthView"
EnableNavigation="True"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
DataSource="{Binding Appointments}">
<syncfusion:SfSchedule.InlineView>
<ContentView>
</ContentView>
</syncfusion:SfSchedule.InlineView>
<syncfusion:SfSchedule.MonthViewSettings>
<syncfusion:MonthViewSettings ShowAgendaView="true"
AppointmentDisplayMode="Appointment">
</syncfusion:MonthViewSettings>
</syncfusion:SfSchedule.MonthViewSettings>
</syncfusion:SfSchedule>
I imagine that we need the context of the selected month day, and maybe should use a ListView to show them. But no idea of how to do that
Hi Felipe,
#Regaeding Custom inlineview in SfSchedule
Your requirement can be achieved with help of InlineView property in SfSchedule. You can set the itemsource for listview inside the cell tapped event. Please refer to the following code snippet for your reference.
Code snippet
|
<schedule:SfSchedule x:Name="Schedule" DataSource="{Binding Meetings}" ShowAppointmentsInline="True" ScheduleView="MonthView" Margin="0"> <schedule:SfSchedule.InlineView> <ListView x:Name="ListView"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid BackgroundColor="{Binding Color}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <StackLayout Orientation="Vertical" Grid.Column="0" > <Label Text = "{Binding From, Converter={StaticResource stringConverter}}" FontSize="14" /> <Label Text="{Binding To, Converter={StaticResource stringConverter}}" FontSize="14"/> </StackLayout> <StackLayout Orientation="Vertical" Padding="40,0,0,0" Grid.Column="1"> <Label Text = "{Binding EventName}" FontSize="20" FontAttributes="Bold" /> </StackLayout> </Grid> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> </schedule:SfSchedule.InlineView> |
Inside the Cell Tapped Event
|
private void Schedule_CellTapped(object sender, CellTappedEventArgs e) { ListView.ItemsSource = e.Appointments; } |
Please refer to the demo sample in the following locations.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ScheduleXamarin1060246074
Please let us know if you have any concerns.
Regards,
SaiGanesh Sakthivel
Is it possible to use same position as AgendaView? To display in the bottom instead of ShowAppointmentsInline? Whe I try to set ShowAgendaView="true" I got a object not referenced exception
Hi Felipe,
#Regaeding Custom Agendaview in SfSchedule
Schedule InlineView property will applicable only for the MonthView inlineview. We suggest you load the appointments in the listview below the schedule control to achieve the custom agendaview display. Please refer to the sample in the following location for your reference.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ScheduleXamarin4307268
Please let us know if you have any concerns.
Regards,
SaiGanesh Sakthivel
Thanks a lot