Breaking Changes in 3.0.0
Common Changes
OnRead
The OnRead handlers of all components now expect you to set the data to an event argument instead of the component Data attribute. This new data binding mechanism will no longer depend on the component life cycle and will allow new features, which could not be supported in the past (such as Excel export of all pages with OnRead).
Note the following changes when using manual data operations:
- Set the
TItemattribute of the component. This will provide information about the model type, instead ofData. - Set the
TValueattribute for ComboBox, DropDownList and MultiSelect. - Do not set the
Dataattribute. Instead, setargs.Data(IEnumerable) in theOnReadhandler. - There is no need to cast the items returned by
ToDataSourceResult()when settingargs.Data. - Do not set
TotalCount. This attribute is now removed in favor of theargs.Totalevent argument (int) in theOnReadhandler. - Aggregates over all the data are now supported via
args.AggregateResults(IEnumerable<AggregateResult>). TheAggregateResultsevent argument is exposed only for components that support aggregates. If the Grid is bound toDataTable, a workaround is still necessary. - If you have cached the
DataSourceRequestobject in order to setDatalater, the new approach is to reset the Grid state, so thatOnReadis called again. - Binding to
ObservableDataviaOnReadis no longer supported. - UI for Blazor 3.0.1 introduced a
Rebindmethod that triggersOnReadfor on-demand data updates. Here is a rebind example for the Grid and a similar one for the ComboBox.
OnRead Usage in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
RAZOR
|
RAZOR
RAZOR
|
Popup Settings
PopupClass,PopupHeightandPopupWidthattributes are removed in favor of a nested popup settings tag. Applies to AutoComplete, ComboBox, DropDownList and MultiSelect. The nested tag name depend on the component name.
Popup configuration in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
|
RAZOR
|
Other Common Changes
ToODataStringextension method is moved to theTelerik.Blazor.Extensionsnamespace. TheTelerik.Blazor.ExtensionMethodsnamespace is removed in favor ofTelerik.Blazor.Extensions.Telerik.Blazor.IconNameclass (obsolete since version 2.0) is removed. Use the icon names from the Built-in Icons documentation.
Component Changes
Grid
- Changed
GridEditModeenum default value fromInlinetoNone. Grid editing should be explicitly enabled for theAddandEditcommand buttons to work. - Changed the popup edit form orientation to vertical. This is now consistent will the default
TelerikFormOrientationand the popup edit forms in all components. UI for Blazor 3.1 will provide popup configuration settings. - Use
IFilterDescriptorto work with the Grid state, instead ofFilterDescriptorBase. - Removed method
ExportToExcel()(MemoryStream) in favor ofExportToExcelAsync()(Task<MemoryStream>). - Removed method
ExportToCsv()(MemoryStream) in favor ofExportToCsvAsync()(Task<MemoryStream>).
Grid export stream in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
C#
|
C#
|
- Removed
ExpandedRows(ICollection<int>) in favor ofExpandedItems(ICollection<TItem>) in the GridState.ExpandedItemsexpects items, instead of item indexes. Also, thePropertyNameargument in theOnStateChangedevent changes from"ExpandedRows"to"ExpandedItems"in hierarchy scenarios.
Expand Grid rows in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
C#
|
C#
|
Other Components
- Button - removed
Primaryparameter in favor ofThemeColorof typestring. There is a new static classTelerik.Blazor.ThemeConstants.Button.ThemeColorwith a predefined set of theme colors. To get the old primary Button styling, setThemeColor="@ThemeConstants.Button.ThemeColor.Primary".
Primary Button style in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
|
RAZOR
|
-
DateInput – removed
ParsingErrorMessage(obsolete since version 2.8) in favor ofDateInput_ParsingErrorMessagelocalization string. -
Loader, LoaderContainer - changed
Sizeparameter type fromLoaderSizeenum tostring(example below). The default value ofSizeisThemeConstants.Loader.Size.Medium. There is a new static classTelerik.Blazor.ThemeConstants.Loader.Sizewith a predefined set of size properties. -
Notification, Loader, LoaderContainer - changed
ThemeColorparameter type fromThemeColorsenum tostring. The default value ofThemeColorisThemeConstants.Loader.ThemeColor.Primary. There is a new static classTelerik.Blazor.ThemeConstants.Loader.ThemeColorwith a predefined set of properties.
Loader and LoaderContainer in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
|
RAZOR
|
- TextBox, MaskedTextBox, TextArea -
Labelparameter is removed. UI for Blazor 3.1.0 features a standalone FloatingLabel component. For UI for Blazor 3.0.0 and 3.0.1, check the following KB that shows how to add a label.
TextBox Label in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
|
RAZOR
|
- TileLayout - introduced optional
Idattribute for theTileLayoutItem. TheOnResizeevent handler will receive argument of typeTileLayoutResizeEventArgs. TheOnReorderevent handler will receive argument of typeTileLayoutReorderEventArgs. Both event arguments will point to the tile item (args.Id) and define if the component should re-render after the event (args.ShouldRender).
TileLayout resize and reorder events in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
|
RAZOR
|
-
TreeList - changed
TreeListEditModeenum default value fromInlinetoNone. TreeList editing should be explicitly enabled for theAddandEditcommand buttons to work. -
TreeList - changed the popup edit form orientation to vertical. This is now consistent will the default
TelerikFormOrientationand the popup edit forms of all components. UI for Blazor 3.1 will provide popup configuration settings. -
TreeView - removed
ExpandedFieldparameter in favor ofExpandedItems(IEnumerable<object>). The expanded state of TreeView items will no longer depend on a model property.ExpandedItemssupports two-way binding.
TreeView expanded items in UI for Blazor up to version 2.30 and after version 3.0
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
RAZOR
RAZOR
|
RAZOR
RAZOR
|
- Window - changed
Sizeparameter type fromWindowSizeenum tostring. There is a new static classTelerik.Blazor.ThemeConstants.Window.Sizewith a predefined set of size properties. To maintain the old behavior, set the WindowWidthto300px,800pxor1200px.
Parameter Names
We are making our API naming more consistent.
- Drawer -
ContentRenderFragment is renamed toDrawerContent - Drawer -
IsSeparatorFieldparameter (obsolete since version 2.27) is removed in favor ofSeparatorField - Editor -
UpdateIntervalparameter is renamed toDebounceDelay - Stepper -
IsCanceledproperty inStepperStepChangeEventArgs(obsolete since version 2.26) is removed in favor ofIsCancelled
Rendering and Themes
The HTML rendering and CSS classes have been updated for multiple components, including Buttons, Textbox components, Dropdown components, Date/Time Pickers, Checkbox, Switch. Recreate any custom themes.
CSS Classes for State
Some CSS classes related to component state were renamed.
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
k-state-disabled | k-disabled |
k-state-focused | k-focus |
k-state-invalid | k-invalid |
k-state-selected | k-selected |
k-widget Class
The k-widget CSS class was removed from all components. If you use this class in custom CSS code, replace it with the corresponding component-specific classes.
| UI for Blazor 2.30 | UI for Blazor 3.0 |
|---|---|
|
HTML
|
HTML
|
Component Widths
- Dropdown components – removed the default inline style of
width: 300px. The new default width is100%and comes from the theme CSS. Applies to AutoComplete, ComboBox, DropDownList, MultiSelect. - Textbox components - changed the default theme width from
12.4emto100%. Applies to DateInput, Date/Time Picker, MaskedTextBox, NumericTextBox, TextArea, TextBox.
Input Rendering
-
Textbox and dropdown components have new consistent HTML rendering. Note the
k-inputCSS class, which is now used for the outer component element, instead of the<input>.HTML<span class="k-[COMPONENT] k-input"> <!-- k-picker instead of k-input for the DropDownList --> <input class="k-input-inner" /> <!-- SPAN element instead of INPUT for the DropDownList --> <button class="k-input-button [BUTTON CLASSES]"><!-- button here if needed--></button> </span>
REPL Changes
Telerik REPL for Blazor always uses the latest official version of the Telerik.UI.for.Blazor NuGet package.
Any snippet created before
Telerik.UI.for.Blazorversion 3.0 (January 19, 2022) may need an update due to the above list of changes.