C1Scheduler Task-Based Help > Grouping |
You can easily start grouping by using the C1Scheduler.GroupBy property, which determines the type of grouping to display. The C1Scheduler control supports grouping by contacts, categories, resources, and by the Appointment.Owner property value.
String |
Grouping |
Empty string |
No grouping. |
Category |
Grouping is determined by the Appointment.Categories property value. |
Contact |
Grouping is determined by the Appointment.Links property value. |
Owner |
Grouping is determined by the Appointment.Owner property value. |
Resource |
Grouping is determined by the Appointment.Resources property value. |
Suppose you have a schedule linked to a calendar in your project. Your XAML might look similar to the following:
XAML (WPF) |
Copy Code
|
---|---|
<Window x:Class="Grouping.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="574" Width="757" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:c1sched="http://schemas.componentone.com/wpf/Schedule" Loaded="Window_Loaded"> <Grid Height="371" Width="689"> <c1:C1Calendar x:Name="cal1" CalendarHelper="{Binding CalendarHelper, ElementName=sched1, Mode=OneWay}" SelectedDates="{Binding VisibleDates, ElementName=sched1, Mode=OneWay}" BoldedDates="{Binding BoldedDates, ElementName=sched1, Mode=OneWay}" MaxSelectionCount="42" Margin="-9,7,459,188" /> <c1:C1Scheduler x:Name="sched1" Margin="195,0,12,62"/> </Grid> </Window> |
XAML (Silverlight) |
Copy Code
|
---|---|
<UserControl x:Class="SilverlightApplication11.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="540" d:DesignWidth="687" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"> <Grid x:Name="LayoutRoot" Background="White" Height="434" Width="591"> <c1:C1Calendar x:Name="cal1" CalendarHelper="{Binding CalendarHelper, ElementName=sched1, Mode=OneWay}" SelectedDates="{Binding VisibleDates, ElementName=sched1, Mode=OneWay}" BoldedDates="{Binding BoldedDates, ElementName=sched1, Mode=OneWay}" MaxSelectionCount="42" Margin="-9,7,459,188" /> <c1:C1Scheduler x:Name="sched1" Margin="195,0,12,62"/> </Grid> </UserControl> |
Double-click the MainWindow and add the following code to the Window_Loaded event:
Visual Basic |
Copy Code
|
---|---|
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) sched1.GroupBy = "Category" End Sub |
C# |
Copy Code
|
---|---|
private void Window_Loaded(object sender, RoutedEventArgs e) { sched1.GroupBy = "Category"; } |
When you run the project, the schedule will be grouped by categories. This is a simplified example. For a full sample, see the Grouping sample that is installed with the product.