AstrolUI AstrolUI
Yellow Orange Red Green Blue Purple Custom color
Light mode
Assign

1. Demo AstrolAssign

Note
The component can receive any type of object list in its UnAssignedList and AssignedList properties. For this, it is mandatory to represent one of the properties in the component using the PropertyShow parameter.
You can also specify, if desired, that your object has a unique property that is not displayed but is used for internal processing. For this purpose, the PropertyUnique parameter is used.
The PropertyUnique parameter is not required, but if not specified, it assumes that the PropertyShow parameter is unique.
The x/y counter of each column selects or deselects all filtered items.

Not assigned
20/20
Juan
María
Pedro
Ana
Luis
Laura
Carlos
Sofía
Miguel
Lucía
Andrés
Carolina
Javier
Valeria
Ricardo
Isabel
Roberto
Daniela
Gonzalo
Camila
Assigned
0/0
Not assigned: Juan, María, Pedro, Ana, Luis, Laura, Carlos, Sofía, Miguel, Lucía, Andrés, Carolina, Javier, Valeria, Ricardo, Isabel, Roberto, Daniela, Gonzalo, Camila
Assigned:
@using Astrol.Component.Basic.Assign
<AstrolAssign TItem="Person"
              Height="300px"
              UnAssignedList="unAssignedList"
              AssignedList="assignedList"
              PropertyShow="@nameof(Person.Name)"
              PropertyUnique="@nameof(Person.Id)"
              UnAssignedTitle="Not assigned"
              AssignedTitle="Assigned"
              PlaceholderInputSearch="Search..."
              OnChange="HandleMyEvent" />
@code {
   List<Person> assignedList = new List<Person>();
   List<Person> unAssignedList = new List<Person>()
   {
       new Person() { Id = 1, Name = "Juan", Age = 25, Sex = true },
       new Person() { Id = 2, Name = "María", Age = 30, Sex = false },
       new Person() { Id = 3, Name = "Pedro", Age = 40, Sex = true },
       new Person() { Id = 4, Name = "Ana", Age = 35, Sex = false },
       new Person() { Id = 5, Name = "Luis", Age = 28, Sex = true },
   };
   private void HandleMyEvent((List<Person>, List<Person>) items)
   {
       unAssignedList = items.Item1;
       assignedList = items.Item2;
   }
   public class Person
   {
       public int Id { get; set; }
       public string Name { get; set; }
       public int Age { get; set; }
       public bool Sex { get; set; }
   }
}

Supported parameters

  • TItem (generic type): object, entity or model of the items in both lists.
  • UnAssignedList (List<TItem>?): unassigned items (left column). The component modifies it in place when items are moved.
  • AssignedList (List<TItem>?): assigned items (right column). The component modifies it in place when items are moved.
  • PropertyShow (string): name of the TItem property displayed in both columns and used by the search (case-insensitive). If not set or not found, the item's ToString() is displayed.
  • PropertyUnique (string?): name of the TItem property that uniquely identifies each item (internal use, not displayed). Not required; if not set or not found, PropertyShow is used as the identifier.
  • UnAssignedTitle (string?): title of the unassigned column. If not set, it follows the app language (Unassigned / No asignados).
  • AssignedTitle (string?): title of the assigned column. If not set, it follows the app language (Assigned / Asignados).
  • PlaceholderInputSearch (string?): placeholder of both search inputs. If not set, it follows the app language (Search / Buscar).
  • BorderRadius (string?): border radius of both columns (default: the theme radius, 12px).
  • Height (string?): height of the component (default is 300px).
  • Outline (bool): shows the column headers with a light style (gray background, dark text) instead of the theme color (default is false). Only applied when the component is initialized.
  • OnChange (EventCallback<(List<TItem>, List<TItem>)>): raised every time items are assigned, unassigned or exchanged. It receives a tuple: Item1 is the unassigned list and Item2 the assigned list.
  • Refresh() (public method): clears the selections and re-applies the filters. Call it through @ref if you change the lists from outside the component.
  • Keyboard: items and the center buttons are activated with Enter or Space.
Markdown for AI © 2026 AstrolUI v10.0.13