Class ScheduleGroup
A class that represents the resource grouping related configurations on SfSchedule<TValue> component.
Inheritance
Namespace: Syncfusion.Blazor.Schedule
Assembly: Syncfusion.Blazor.dll
Syntax
public class ScheduleGroup : OwningComponentBase
Remarks
You can configure the resource grouping by specifying values for the corresponding properties.
Examples
The following code example shows how to configure the resource grouping
<SfSchedule TValue="AppointmentData">
<ScheduleGroup Resources="@Resources" AllowGroupEdit="false" ByDate="false" EnableCompactView="false"></ScheduleGroup>
</SfSchedule>
@code {
string[] Resources { get; set; } = { "Rooms", "Owners" };
}
Constructors
ScheduleGroup()
Declaration
public ScheduleGroup()
Properties
AllowGroupEdit
Gets or sets whether the group editing is enabled in the scheduler.
Declaration
public bool AllowGroupEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Set to |
Remarks
Group editing is performed on multiple resources based on the Id value on appointments. It is mandatory to group the resources as an array type and map them to the appointment data's resource field.
Examples
<SfSchedule TValue="AppointmentData">
<ScheduleGroup Resources="@Resources" AllowGroupEdit="true"></ScheduleGroup>
<ScheduleResources>
<ScheduleResource TItem="ResourceData" TValue="int[]" DataSource="@OwnersData" Field="OwnerId" Title="Owner" Name="Owners" TextField="Text" IdField="Id" GroupIDField="OwnerGroupId" AllowMultiple="true"></ScheduleResource>
</ScheduleResources>
</SfSchedule>
@code {
string[] Resources { get; set; } = { "Owners" };
public List<ResourceData> OwnersData { get; set; } = new List<ResourceData>
{
new ResourceData{ Text = "Nancy", Id = 1 },
new ResourceData{ Text = "Steven", Id = 2 }
};
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public int[] OwnerId { get; set; }
}
public class ResourceData
{
public int Id { get; set; }
public string Text { get; set; }
}
}
ByDate
Gets or sets whether to group resources under each date.
Declaration
public bool ByDate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Set to |
Remarks
This property is applicable only for Day, Week, WorkWeek, Month and Agenda Views.
ByGroupID
Gets or sets whether to render the resource hierarchy based on the value mapped to GroupIDField.
Declaration
public bool ByGroupID { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Set to |
ChildContent
Gets or sets the child content of schedule group.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | The value used to build the content. |
EnableCompactView
Gets or sets whether to display the resource grouping layout in normal or compact mode on mobile devices.
Declaration
public bool EnableCompactView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Set to |
HeaderTooltipTemplate
Gets or sets template as a Microsoft.AspNetCore.Components.RenderFragment<> that defines custom appearance for displaying the resource header tooltip.
Declaration
public RenderFragment<TemplateContext> HeaderTooltipTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<TemplateContext> | A template content that specifies the visualization of resource header tooltip. By default, no tooltip will be displayed on resource header. |
Examples
<SfSchedule TValue="AppointmentData">
<ScheduleGroup Resources="@Resources">
<HeaderTooltipTemplate>
@{
var resourceData = (context as TemplateContext).ResourceData as ResourceData;
<div class='template-wrap'>
<div class="resource-name">@(resourceData.Text)</div>
</div>
}
</HeaderTooltipTemplate>
</ScheduleGroup>
</SfSchedule>
@code{
string[] Resources { get; set; } = { "Conferences" };
public class ResourceData
{
public int Id { get; set; }
public string Text { get; set; }
}
}
HideNonWorkingDays
Gets or sets whether to show/hide the non-working days.
Declaration
public bool HideNonWorkingDays { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, to hide the non-working days. The default value is |
Remarks
This property is only applicable when ByDate is set to true
, and only affects the Day, Week, WorkWeek, and Month views.
Examples
<SfSchedule>
<ScheduleGroup ByDate="true" HideNonWorkingDays="true"></ScheduleGroup>
</SfSchedule>
Resources
Gets or sets the collection of resource names assigned to each resources, which determines the grouping order in the scheduler.
Declaration
public string[] Resources { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | The collection should be an array of strings. The default value is |
Remarks
If this property is set to null
, grouping will be disabled and the scheduler will be rendered without grouping.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose(Boolean)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Boolean value to dispose the object. |
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |