Skip to content

Commit 179acb7

Browse files
github-actions[bot]KB Botntachevadimodi
authored
Added new kb article date-range-picker-vertical-input-alignment (#2192)
* Added new kb article date-range-picker-vertical-input-alignment * Update knowledge-base/date-range-picker-vertical-input-alignment.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Update knowledge-base/date-range-picker-vertical-input-alignment.md Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * chore(daterangepicker): update kb --------- Co-authored-by: KB Bot <kb-bot@telerik.com> Co-authored-by: Nadezhda Tacheva <73842592+ntacheva@users.noreply.github.com> Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> Co-authored-by: Nadezhda Tacheva <Nadezhda.Tacheva@progress.com>
1 parent 43cb79e commit 179acb7

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Align DateRangePicker Inputs Vertically
3+
description: Learn how to modify the layout of the DateRangePicker in Blazor to display its inputs vertically using custom CSS.
4+
type: how-to
5+
page_title: How to Display DateRangePicker Inputs Vertically
6+
slug: daterangepicker-kb-vertical-input-alignment
7+
tags: datarangepicker, blazor, css, layout, vertical, align
8+
res_type: kb
9+
ticketid: 1656293
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tbody>
16+
<tr>
17+
<td>Product</td>
18+
<td>DateRangePicker for Blazor</td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
23+
## Description
24+
25+
This KB article answers the following questions:
26+
- How to change the layout of DateRangePicker inputs in Blazor, so they appear vertically oriented?
27+
- Can I display DateRangePicker inputs vertically in Blazor?
28+
- Is there a way to adjust the DateRangePicker so the inputs appear on two lines, one on top of each other?
29+
30+
## Solution
31+
32+
To align the inputs of the DateRangePicker vertically, apply custom CSS to adjust the component's layout. Follow these steps:
33+
34+
1. Add a custom CSS class to the DateRangePicker through the `Class` parameter.
35+
2. Use the custom class to target the wrapping element of the DateRangePicker and apply the necessary styles.
36+
3. (Optional) Adjust the popup calendar orientation if needed.
37+
38+
Here is an example implementation:
39+
40+
```CSHTML
41+
<style>
42+
.vertical-picker {
43+
flex-direction: column;
44+
align-items: baseline;
45+
width: 140px;
46+
}
47+
</style>
48+
49+
<TelerikDateRangePicker @bind-StartValue="@StartValue"
50+
@bind-EndValue="@EndValue"
51+
Class="vertical-picker"
52+
Orientation="CalendarOrientation.Vertical">
53+
</TelerikDateRangePicker>
54+
55+
@code {
56+
private DateTime? StartValue { get; set; } = DateTime.Today;
57+
private DateTime? EndValue { get; set; } = DateTime.Today.AddDays(10);
58+
}
59+
```
60+
61+
This CSS ensures that the labels and inputs of the DateRangePicker display one below the other. Adjust the styles as needed to fit your design requirements better. Additionally, consider [repositioning the labels so they appear on the side and not on top of the inputs]({%slug daterangepicker-kb-reposition-labels%}).
62+
63+
## See Also
64+
65+
- [Repositioning Labels in DateRangePicker](https://docs.telerik.com/blazor-ui/knowledge-base/daterangepicker-reposition-labels)
66+
- [DateRangePicker Overview](https://docs.telerik.com/blazor-ui/components/daterangepicker/overview)

0 commit comments

Comments
 (0)