ABP Blazorise 1.x to 2.0 Migration Guide
This document summarizes the required code changes when upgrading ABP solutions from Blazorise 1.x to 2.0.
1. Package upgrades
Upgrade Blazorise-related packages to 2.0.0.
BlazoriseBlazorise.ComponentsBlazorise.DataGridBlazorise.SnackbarBlazorise.Bootstrap5Blazorise.Icons.FontAwesome
2. Input component renames
Blazorise 2.0 uses new input component names:
TextEdit->TextInputMemoEdit->MemoInputDateEdit->DateInputTimeEdit->TimeInputNumericEdit->NumericInputColorEdit->ColorInputFileEdit->FileInput
3. Binding API normalization to Value/ValueChanged
Migrate old binding/value APIs to the new Value model.
@bind-Text->@bind-ValueText/TextChanged->Value/ValueChanged@bind-Checked->@bind-ValueChecked/CheckedChanged->Value/ValueChangedCheckedValue/CheckedValueChanged->Value/ValueChanged@bind-Date/@bind-Time->@bind-ValueDate/DateChanged->Value/ValueChangedTime/TimeChanged->Value/ValueChanged@bind-SelectedValue(forSelect) ->@bind-ValueSelectedValue/SelectedValueChanged(forSelect) ->Value/ValueChanged@bind-Checked(forSwitch) ->@bind-ValueChecked/CheckedChanged(forSwitch) ->Value/ValueChanged
4. DatePicker and Select multiple changes
DatePicker range mode
For SelectionMode="DateInputSelectionMode.Range", the old Dates / DatesChanged parameters are replaced by the unified Value / ValueChanged. Use an array or IReadOnlyList<T> as TValue:
@bind-Dates->@bind-Value(withTValue="DateTime[]"orTValue="IReadOnlyList<DateTime>")Dates/DatesChanged->Value/ValueChanged
DatePicker single value mode
For non-range DatePicker usage:
Date/DateChanged->Value/ValueChanged
Select multiple mode
For <Select Multiple ...>, the old SelectedValues / SelectedValuesChanged parameters are replaced by the unified Value / ValueChanged. Use an array or IReadOnlyList<T> as TValue:
@bind-SelectedValues->@bind-Value(withTValue="string[]"orTValue="IReadOnlyList<string>")SelectedValues/SelectedValuesChanged->Value/ValueChanged
Example:
<Select TValue="int[]" @bind-Value="Selected" Multiple>
<SelectItem Value="1">One</SelectItem>
<SelectItem Value="2">Two</SelectItem>
</Select>
@code {
private int[] Selected { get; set; } = new int[] { 1 };
}
Empty SelectItem type requirement
For empty placeholder items, set explicit TValue:
<SelectItem></SelectItem>-><SelectItem TValue="string"></SelectItem>(or another correct type such asGuid?)
5. DataGrid migration
5.1 Page parameter rename
CurrentPage->PageonDataGrid
Important: AbpExtensibleDataGrid still uses CurrentPage (for example ABP v10.2). Do not rename it to Page.
5.2 DisplayTemplate context type change
Inside DisplayTemplate, use context.Item instead of directly using context.
Typical updates:
context.Property->context.Item.PropertyMethod(context)->Method(context.Item)() => Method(context)->() => Method(context.Item)- For custom template variable names, same rule applies:
row.Property->row.Item.Property
The same rule also applies to action handlers in DataGridEntityActionsColumn and DataGridCommandColumn (such as Clicked, Visible, and ConfirmationMessage):
Clicked="async () => await action.Clicked(context)"->Clicked="async () => await action.Clicked(context.Item)"Visible="action.Visible(context)"->Visible="action.Visible(context.Item)"
Important: This change applies to DataGrid template contexts only (DisplayTemplate in DataGridColumn, DataGridEntityActionsColumn, etc.). In non-DataGrid templates (for example TreeView NodeContent), context is already the item and should remain unchanged (for example DeleteMenuItemAsync(context)).
5.3 Width type change (string -> Fluent sizing)
DataGrid column Width moved from plain string to fluent sizing APIs:
Width="30px"->Width="Width.Px(30)"Width="60px"->Width="Width.Px(60)"Width="0.5rem"->Width="Width.Px(8)"(or another equivalent pixel value)Width="50%"->Width="Width.Percent(50)"orWidth="Width.Is50"Width="100%"->Width="Width.Is100"
For dynamic string widths (for example column.Width), ABP introduces BlazoriseFluentSizingParse.Parse(...) to convert string values into IFluentSizingStyle.
Width="@BlazoriseFluentSizingParse.Parse(column.Width)" // column.Width is a string
6. Modal parameter placement changes
Size and Centered should be placed on <Modal>, not on <ModalContent>.
<ModalContent Size="..." Centered="true">-><Modal Size="..." Centered="true">+<ModalContent>
7. Other component parameter changes
Dropdown RightAligned="true"->Dropdown EndAligned="true"Autocomplete MinLength->MinSearchLength
8. Notes from ABP migration implementation
- Keep component-specific behavior in mind. Not every component follows exactly the same rename pattern.
Autocompleteusage can still involveSelectedValue/SelectedValueChanged, depending on component API.BarDropdownandDropdownare different components; align parameter names according to the actual component type.
Reference
This document may not cover all Blazorise 2.0 changes. For completeness, refer to the official migration guide and release notes: