Skip to content

Commit

Permalink
Added AdditionalContent Parameter to Scheduler (#1717)
Browse files Browse the repository at this point in the history
* feat: add AdditionalContent parameter for rendering custom content next to year, month, and day buttons in RadzenScheduler

* Change name variable
  • Loading branch information
bikotoru authored Oct 1, 2024
1 parent 56156dd commit 1d869e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Radzen.Blazor/RadzenScheduler.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@
</div>
<div class="rz-scheduler-nav-title">@SelectedView?.Title</div>
<div class="rz-scheduler-nav-views">
@foreach (var view in Views)
{
<RadzenButton Click=@(args => OnChangeView(view)) Icon=@view.Icon Text=@view.Text class="@($"{(IsSelected(view)? " rz-state-active" : "")}")" />
}
@if (NavigationTemplate != null)
{
@NavigationTemplate
}
else
{
@foreach (var view in Views)
{
<RadzenButton Click=@(args => OnChangeView(view)) Icon=@view.Icon Text=@view.Text class="@($"{(IsSelected(view) ? " rz-state-active" : "")}")" />
}
}
</div>
</div>
@SelectedView?.Render()
Expand Down
10 changes: 10 additions & 0 deletions Radzen.Blazor/RadzenScheduler.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ public partial class RadzenScheduler<TItem> : RadzenComponent, IScheduler
/// <value>The template.</value>
[Parameter]
public RenderFragment<TItem> Template { get; set; }

/// <summary>
/// Gets or sets the additional content to be rendered in place of the default navigation buttons in the scheduler.
/// This property allows for complete customization of the navigation controls, replacing the native date navigation buttons (such as year, month, and day) with user-defined content or buttons.
/// Use this to add custom controls or interactive elements that better suit your application's requirements.
/// </summary>
/// <value>The custom navigation template to replace default navigation buttons.</value>
[Parameter]
public RenderFragment NavigationTemplate { get; set; }


/// <summary>
/// Gets or sets the data of RadzenScheduler. It will display an appointment for every item of the collection which is within the current view date range.
Expand Down

0 comments on commit 1d869e8

Please sign in to comment.