# Dropdown doesn't respond to alignment commands

**URL:** <https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467>\
**Category:** Blazor Server\
**Created:** [July 31, 2020, 1:31pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467 "2020-07-31T13:31:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ipe](https://forum.radzen.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@ipe](https://forum.radzen.com/u/ipe)\
**Post date:** [July 31, 2020, 1:31pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/1 "2020-07-31T13:31:36Z")

</div>

Hi,  
It appears to me that the RadzenDropdown component always renders in the top left corner of the container and doesn't respond to alignment commands. Is there a way to have the dropdown vertically centered, for example? I've tried Bootstrap alignment classes with no success.

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 31, 2020, 2:18pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/2 "2020-07-31T14:18:00Z")

</div>

Just tried to right align DropDown in a column with Radzen and worked normally for me:

 ![image](https://forum.radzen.com/uploads/default/original/2X/4/47cc9ff25f7efffce58f5cb6264934fe73a27fb3.png)

---

<div class="post-metadata">

**Author:** ![ipe](https://forum.radzen.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@ipe](https://forum.radzen.com/u/ipe)\
**Post date:** [July 31, 2020, 2:47pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/3 "2020-07-31T14:47:27Z")

</div>

Hi @enchev,  
Thanks for the reply! How would you define vertical alignment for the elements in the screenshot below?

![image](https://forum.radzen.com/uploads/default/original/2X/7/71f45043595c6d4274586ddc46821835a311b02c.png)

---

<div class="post-metadata">

**Author:** ![ipe](https://forum.radzen.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@ipe](https://forum.radzen.com/u/ipe)\
**Post date:** [July 31, 2020, 2:50pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/4 "2020-07-31T14:50:15Z")

</div>

..and the code:

```
<div class="row aw-col-border2 text-light awbg-light align-items-baseline">
		<div class="col-12 p-2 align-items-baseline align-self-baseline">
			<RadzenDropDown AllowClear="false" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" @bind-Value="@selectedGroupID"
							Multiple="false" Data="@groups" TextProperty="Name" ValueProperty="ID" Style="width:500px;" Change="@ChangeGroup" />
			<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Add new group" @onclick="OnAddGroup">Add</button>
			@if (IsGroupDeletingEnabled)
			{
				<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Delete selected group" @onclick="OnDeleteGroup">Delete</button>
			}
			else
			{
				<button type="button" class="btn btn-secondary" disabled data-toggle="tooltip" data-placement="top" title="Delete selected group" @onclick="OnDeleteGroup">Delete</button>
			}
			<RadzenTextBox @bind-Value="@groupName" MaxLength="30" />
			<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Save group name" @onclick="OnSaveGroupName">Save</button>
		</div>
	</div>

```

It's currently align-items-baseline but align-items-center doesn't have the desired outcome either.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [July 31, 2020, 3:19pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/5 "2020-07-31T15:19:33Z")

</div>

Those Bootstrap classes align the element themselves and not their content. I recommend referring to the [Bootstrap documentation](https://getbootstrap.com/docs/4.0/utilities/flex/#justify-content).

---

<div class="post-metadata">

**Author:** ![ipe](https://forum.radzen.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@ipe](https://forum.radzen.com/u/ipe)\
**Post date:** [July 31, 2020, 3:42pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/6 "2020-07-31T15:42:23Z")

</div>

You're right, d-flex was missing. I'm new to web development as you might tell. Thanks!

---

<div class="post-metadata">

**Author:** ![SloSuenos](https://forum.radzen.com/user_avatar/forum.radzen.com/slosuenos/32/9256_2.png) [@SloSuenos](https://forum.radzen.com/u/SloSuenos)\
**Post date:** [November 6, 2020, 7:26pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/7 "2020-11-06T19:26:55Z")

</div>

Hello Radzen Team,

I can't believe I can't get my dropdown to align with these buttons that were automatically generated, and am surprised that this isn't a very common issue.

 ![image](https://forum.radzen.com/uploads/default/original/2X/2/2bccd301e89cee1224217c21994009d5ee62ad7f.png)

So I need to do something with dflex? Is that something I'd set on the containing row, or on the dropdown, or...?

Thanks for any help,  
Slosuenos

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [November 7, 2020, 6:18am UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/8 "2020-11-07T06:18:09Z")

</div>

Use the suggestion that @enchev gave. Put them inside a Column component and set its vertical alignment to Center.

 ![image](https://forum.radzen.com/uploads/default/original/2X/4/4f4ccbc98d73039b3f007a8205bb694c148f2696.png)

This happens because HTML and CSS follow some rules which are sometimes hard to reason(vertical alignment especially). Check this StackOverflow question for an example which is similar to this case: [https://stackoverflow.com/questions/44933315/two-divs-with-inline-block-style-not-aligned](https://stackoverflow.com/questions/44933315/two-divs-with-inline-block-style-not-aligned). The solution is to either set the vertical alignment of all inline-block elements to something other than the default (baseline) or put them in an element with a flex display and set the vertical alignment (which is the solution I provided).

---

<div class="post-metadata">

**Author:** ![SloSuenos](https://forum.radzen.com/user_avatar/forum.radzen.com/slosuenos/32/9256_2.png) [@SloSuenos](https://forum.radzen.com/u/SloSuenos)\
**Post date:** [November 7, 2020, 5:55pm UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/9 "2020-11-07T17:55:31Z")

</div>

@korchev thank you! And thanks for providing an explanation...

Slosuenos

---

<div class="post-metadata">

**Author:** ![ipe](https://forum.radzen.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@ipe](https://forum.radzen.com/u/ipe)\
**Post date:** [November 9, 2020, 6:47am UTC](https://forum.radzen.com/t/dropdown-doesnt-respond-to-alignment-commands/4467/10 "2020-11-09T06:47:16Z")

</div>

Hi,  
Let me also paste my code as it is currently working, should someone still have the same issue.

```
<div class="row aw-col-border2 text-light awbg-light">
		<div class="col-12 p-2 d-flex align-items-center">
			<RadzenDropDown AllowClear="false" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" @bind-Value="@selectedGroupID"
							Multiple="false" Data="@groups" TextProperty="Name" ValueProperty="ID" Style="width:500px;" Change="@ChangeGroup" />
			<span>&nbsp;</span>
			<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Add new group" @onclick="OnAddGroup">Add</button>
			<span>&nbsp;</span>
			@if (IsGroupDeletingEnabled)
			{
				<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Delete selected group" @onclick="OnDeleteGroup">Delete</button>
			}
			else
			{
				<button type="button" class="btn btn-secondary" disabled data-toggle="tooltip" data-placement="top" title="Delete selected group" @onclick="OnDeleteGroup">Delete</button>
			}
			<span>&nbsp;</span>
			<RadzenTextBox @bind-Value="@groupName" MaxLength="30" />
			<span>&nbsp;</span>
			<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Save group name" @onclick="OnSaveGroupName">Save</button>
		</div>
	</div>

```

So there should be the d-flex class in the column component, after which align-items-center will work.
