Skip to content

Commit 04fb3fe

Browse files
authored
Merge pull request #807 from telerik/new-kb-calendar-add-custom-space-footer-b5f0b9a9de3945a08510462453dc074d
Added new kb article calendar-add-custom-space-footer
2 parents 333f529 + 925f407 commit 04fb3fe

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Adding a Custom Panel Between Dates Area and Footer in UI for WinForms Calendar
3+
description: Learn how to add a custom panel between the dates area and footer in the [UI for WinForms Calendar](https://docs.telerik.com/devtools/winforms/controls/calendar/calendar).
4+
type: how-to
5+
page_title: Create a Custom Space Above the Footer in WinForms Calendar
6+
meta_title: Create a Custom Space Above the Footer in WinForms Calendar
7+
slug: calendar-add-custom-space-footer
8+
tags: calendar, ui for winforms, customization, footer, panel
9+
res_type: kb
10+
ticketid: 1566694
11+
---
12+
13+
## Environment
14+
15+
|Product Version|Product|Author|
16+
|----|----|----|
17+
|2025.3.812|RadCalendar for WinForms|[Dinko Krastev](https://www.telerik.com/blogs/author/dinko-krastev)|
18+
19+
## Description
20+
21+
In this tutorial, we will demonstrate how to add a custom panel above the elements inside the footer (where the `<Today>` button resides) in the [UI for WinForms Calendar](https://docs.telerik.com/devtools/winforms/controls/calendar/calendar). This panel can be populated with additional buttons that, when clicked, can select a specific date in the calendar.
22+
23+
![WinForms RadCalendar Footer Customization](images/calendar-add-custom-space-footer01.png)
24+
25+
## Solution
26+
27+
To create a custom space above the footer, use a `StackLayoutElement` and add it to the `CalendarStatusElement.Children` collection. Follow these steps:
28+
29+
Here is an example:
30+
31+
````C#
32+
33+
public Form1()
34+
{
35+
InitializeComponent();
36+
this.radCalendar1.ShowFooter = true; // Enable the footer
37+
38+
// Create a panel and set its orientation
39+
StackLayoutElement panel = new StackLayoutElement();
40+
panel.Orientation = Orientation.Horizontal;
41+
42+
// Add child elements to the panel
43+
RadButtonElement btn1 = new RadButtonElement() { Text = "btn1" };
44+
RadButtonElement btn2 = new RadButtonElement() { Text = "btn2" };
45+
RadButtonElement btn3 = new RadButtonElement() { Text = "btn3" };
46+
panel.Children.Add(btn1);
47+
panel.Children.Add(btn2);
48+
panel.Children.Add(btn3);
49+
50+
// Dock the panel at the top of the footer area
51+
DockLayoutPanel.SetDock(panel, Telerik.WinControls.Layouts.Dock.Top);
52+
53+
// Insert the panel into the footer's children collection
54+
this.radCalendar1.CalendarElement.CalendarStatusElement.Children[0].Children.Insert(0, panel);
55+
}
56+
57+
````
58+
59+
You can subscribe to the Click event on each button and add your custom logic in the event handlers, then further manipulate the RadCalendar dates. Customize the `StackLayoutElement` further to match your requirements.
60+
61+
## See Also
62+
63+
* [UI for WinForms Calendar Overview](https://docs.telerik.com/devtools/winforms/controls/calendar/calendar)
64+
* [Calendar Footer](https://docs.telerik.com/devtools/winforms/controls/calendar/features/footer)
8.6 KB
Loading

0 commit comments

Comments
 (0)