diff --git a/blazor/appearance/figma.md b/blazor/appearance/figma.md index 7b22679bcf..192dc6dde0 100644 --- a/blazor/appearance/figma.md +++ b/blazor/appearance/figma.md @@ -1,31 +1,31 @@ --- layout: post -title: Introduction to the Figma UI Kit in Blazor - Syncfusion -description: Check out and learn about the introduction to the Figma UI Kit in the Syncfusion Blazor and more details. +title: Figma UI kits for Syncfusion Blazor - Syncfusion +description: Learn about Syncfusion’s Figma UI kits for Blazor, available for Material 3, Fluent, Tailwind, and Bootstrap 5 themes, and how to export design tokens. platform: Blazor -component: Common +control: Common documentation: ug --- -# Figma UI Kits for Syncfusion® Controls +# Figma UI kits for Syncfusion® controls -Syncfusion® offers [Figma UI kits](https://www.figma.com/@syncfusion) to facilitate effective collaboration between designers and developers. The Figma UI kits are available in four themes: [Material 3](https://www.figma.com/community/file/1385969023252455137/syncfusion-ui-kit-material-3-theme), [Fluent](https://www.figma.com/community/file/1385969120047188707/syncfusion-ui-kit-fluent-theme), [Tailwind](https://www.figma.com/community/file/1385969065626384098/syncfusion-ui-kit-tailwind-theme), and [Bootstrap 5](https://www.figma.com/community/file/1385968977953858272/syncfusion-ui-kit-bootstrap-5-theme). These kits match the themes used in Syncfusion® controls. +Syncfusion® provides [Figma UI kits](https://www.figma.com/@syncfusion) to streamline collaboration between designers and developers. The kits match the themes used by Syncfusion® Blazor components and are available for [Material 3](https://www.figma.com/community/file/1454123774600129202/syncfusion-ui-kit-material-3-theme), [Fluent](https://www.figma.com/community/file/1385969120047188707/syncfusion-ui-kit-fluent-theme), [Tailwind](https://www.figma.com/community/file/1385969065626384098/syncfusion-ui-kit-tailwind-theme), and [Bootstrap 5](https://www.figma.com/community/file/1385968977953858272/syncfusion-ui-kit-bootstrap-5-theme). -The kits contain reusable design controls with various possible states and variants, along with detailed figures, measurements, and icons, representing the Syncfusion® controls. +Each kit contains reusable design controls with states and variants, along with detailed figures, measurements, and icons that represent Syncfusion® controls. -![Material 3](./images/material3.png) +![Preview of the Material 3 Figma UI kit](./images/material3.png) ## Advantages of UI kits -The Syncfusion® Figma UI kit offers the following key advantages: -- The UI kit includes detailed information about Syncfusion® controls, such as available control lists, their states, and variants. This facilitates a quick understanding of Syncfusion® controls. -- Design controls are developed using the [atomic design methodology](https://atomicdesign.bradfrost.com/chapter-2/), making customization straightforward and efficient. -- Developers can seamlessly match Syncfusion® controls with your design requirements, ensuring alignment and accuracy. -- By using standardized controls and themes, the UI kit ensures consistency in your designs, maintaining a uniform look and feel across projects. +The Syncfusion® Figma UI kits offer the following advantages: +- Detailed information about controls, including lists, states, and variants, to quickly understand available options. +- Design controls follow the [atomic design methodology](https://atomicdesign.bradfrost.com/chapter-2/), making customization straightforward. +- Developers can match Syncfusion® controls to design requirements for alignment and accuracy. +- Standardized controls and themes maintain a consistent look and feel across projects. ## Downloading the UI kits -Syncfusion® Figma UI kits are available in the [Figma community](https://www.figma.com/@syncfusion). You can download the Syncfusion® theme-specific Figma UI kits from the following links: +The Syncfusion® Figma UI kits are available in the [Figma community](https://www.figma.com/@syncfusion). Download the theme-specific kits from the following links: - [Material 3](https://www.figma.com/community/file/1454123774600129202/syncfusion-ui-kit-material-3-theme) - [Fluent](https://www.figma.com/community/file/1385969120047188707/syncfusion-ui-kit-fluent-theme) @@ -34,7 +34,7 @@ Syncfusion® Figma UI kits are available in ## Structure of the UI kits -Syncfusion’s Figma UI kit is structured to offer a comprehensive and user-friendly layout, facilitating easy navigation and exploration of various controls. It includes the following pages: +The Figma UI kits are structured for easy navigation and exploration of controls. They include the following pages: - **Thumbnail**: This page serves as the cover page for the UI kit. - **Index**: Here, users can find a detailed list of all control names, making it simple to identify and locate specific controls within the UI kit. @@ -45,57 +45,57 @@ Syncfusion’s Figma UI kit is structured to offer a comprehensive and user-frie ## Customizing the UI kits -The Syncfusion® Figma UI kits are easily customizable to meet your specific needs, allowing you to create unique designs and adjust colors to match your brand guidelines. The [atomic design methodology](https://atomicdesign.bradfrost.com/chapter-2/) used in developing these controls, your customizations will be seamlessly reflected across multiple controls and their variants. +The Syncfusion® Figma UI kits are customizable to meet specific needs, allowing unique designs and color adjustments to match brand guidelines. Because the controls are built using the [atomic design methodology](https://atomicdesign.bradfrost.com/chapter-2/), customizations will be seamlessly reflected across multiple controls and variants. Here's how to customize the primary button color of the Material 3 theme within your layout: 1. Visit our [UI kits](#downloading-the-ui-kits) and choose your preferred theme, such as the Material 3 theme. -2. Open the selected theme in the Figma web application by clicking the **Open in Figma** button. -3. For the desktop application, click the **Import** button in the top-right corner of the page. Select the downloaded Syncfusion® fig file you want to import and click the **Open** button. +2. Open the selected theme in the Figma web application by clicking **Open in Figma**. +3. For the desktop application, click **Import** in the top-right corner. Select the downloaded Syncfusion® Figma file and click **Open**. 4. Identify the button you wish to customize within your layout. -5. On the right side of the Figma interface, find the color variable options listed. For example, the variable for a particular button color might be labeled as `$primary-bg-color`, derived from the primary color variable. -6. To customize this primary button control color, click outside the button to see the **Local variables** option on the right side of the Figma interface. It contains the design token for the color variables. Click the **Local variables** option. +5. On the right side of the Figma interface, locate the color variables. For example, a button color variable might be labeled `$primary-bg-color`, derived from the primary color variable. +6. To customize the primary button color, click outside the button to reveal the **Local variables** panel. It contains the design tokens for color variables. Click **Local variables**. 7. A popup will show the design token list. You can change the primary color using a color palette. 8. Once you've selected the new color (e.g., pink) for the primary variable, the button's color pattern will be updated accordingly. You'll see the changes reflected in real-time within your design. -![Customization](./images/customize.png) +![Customize a component primary color using local variables](./images/customize.png) In addition to changing the button color, you can also customize other aspects like font, spacing, shadows, etc., of the UI controls: Feel free to experiment with these customization options to create a design that perfectly matches your requirements. -## Downloading the customized styles +## Download customized styles -Effortlessly download customized style changes as tokens and CSS variables using the `Syncfusion® Design Tokens` plugin. This plugin bridges the gap between design and development by converting Figma design variables into Syncfusion® tokens for direct use in your applications to ensure a smooth transition from design to implementation. +Download customized style changes as tokens and CSS variables using the Syncfusion® Design Tokens plugin. This plugin bridges the gap between design and development by converting Figma design variables into Syncfusion® tokens for direct use in your applications to ensure a smooth transition from design to implementation. ### Exporting design tokens Follow these steps to download the customized styles from the Figma UI Kit: - First, open a [Syncfusion® Figma UI Kit](https://www.figma.com/@syncfusion). -- Navigate to the `Plugin & widgets` section in Figma and search for the `Syncfusion® Design Tokens`. -- Once found, run the plugin. A popup will appear with an `Export` button. +- Navigate to the `Plugins and widgets` section in Figma and search for **Syncfusion® Design Tokens**. +- Run the plugin. A dialog appears with an `Export` button. - Click the `Export` button. This action will generate a zip file containing your design tokens. - Select a directory to save the exported files. - Extract the downloaded zip file to access its contents. ![export-design-tokens](./images/syncfusion-design-tokens.png) -### Utilizing design tokens +### Use design tokens The exported zip file includes the following files: - - `css-variables.css`: The css-variables.css file contains CSS variables for both light and dark themes, directly derived from your Figma designs. You can easily import this file into your application alongside the component styles to reflect your custom designs. - - `-tokens.json`: This file (e.g., material3-tokens.json) contains style variables and values in a JSON format compatible with [Theme Studio](./theme-studio). This file, prefixed with the corresponding theme name, can be [imported](./theme-studio#import-previously-changed-settings-into-the-theme-studio) into [Theme Studio](./theme-studio) for further customization. After processing in [Theme Studio](./theme-studio), you can [download](./theme-studio#download-the-customized-theme) the updated styles file and integrate it into your application, bringing your custom themes to life. + - `css-variables.css`: Contains CSS variables for light and dark themes derived from the Figma design. Import this file alongside component styles to reflect custom designs. + - `-tokens.json`: Contains style variables and values in a JSON format compatible with [Theme Studio](./theme-studio). This file, prefixed with the corresponding theme name, can be [imported](./theme-studio#import-previously-changed-settings-into-the-theme-studio) into [Theme Studio](./theme-studio) for further customization. After processing in [Theme Studio](./theme-studio), you can [download](./theme-studio#download-the-customized-theme) the updated styles file and integrate it into your application, bringing your custom themes to life. This streamlined process ensures that your unique design vision, crafted in Figma, is accurately translated into your final application, maintaining consistency between design and implementation. -## Upgrading the UI kits +## Upgrade the UI kits -To upgrade your UI kits, download the latest version from the provided links. Follow these guidelines for a seamless upgrade process: +To upgrade the UI kits, download the latest versions from the links above. Follow these guidelines for a seamless upgrade: - Keep track of updates or new versions of UI kits from Syncfusion. - Before upgrading, back up your ongoing projects to prevent data loss or compatibility issues. -- Share your experience with Syncfusion® regarding the upgraded UI kits, including any issues encountered or suggestions for improvement. +- Share feedback regarding the upgraded UI kits, including any issues encountered or suggestions for improvement. ## See also diff --git a/blazor/appearance/icons.md b/blazor/appearance/icons.md index 016b2911b2..fb5b7efe4f 100644 --- a/blazor/appearance/icons.md +++ b/blazor/appearance/icons.md @@ -1,17 +1,17 @@ --- layout: post -title: Icons Library in Blazor - Syncfusion -description: Checkout and learn here all about how to use Icons in the Syncfusion Blazor Component and its type of icons. +title: Blazor icons library - Syncfusion +description: Learn how to use the Syncfusion Blazor icons with SfIcon and e-icons, set sizes and tooltips, customize appearance, and integrate third-party icon fonts. platform: Blazor -component: Common +control: Common documentation: ug --- -# Blazor Icons Library +# Blazor icons library -The Syncfusion® Blazor library provides the set of `base64` formatted font icons which are being used in the Syncfusion® Blazor components. These icons can be utilized in the web applications using `SfIcon` component or `e-icons` class. +The Syncfusion® Blazor library provides a set of base64-formatted font icons used across Syncfusion® Blazor components. Icons can be used via the `SfIcon` component or the `e-icons` CSS class. -Check out the video to quickly get started with the Blazor Icon component: +Watch a quick-start video for the Blazor Icon component: {% youtube "youtube:https://www.youtube.com/watch?v=H1nQCAHzKZ0"%} @@ -20,7 +20,7 @@ Check out the video to quickly get started with the Blazor Icon component: Syncfusion® Icon component provides support to render predefined Syncfusion® icons or custom font icons. -You can refer [Getting Started with Syncfusion® Blazor for Server-side in Visual Studio page](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) for the introduction and configuring the common specifications. +Refer to the [Getting started with Syncfusion Blazor Web App](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) guide for installation and common configuration. The following code example shows the rendering of built-in Syncfusion® icons from predefined [IconName](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.IconName.html) options using [Name](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.SfIcon.html#Syncfusion_Blazor_Buttons_SfIcon_Name) property by defining them in `SfIcon` tag. @@ -39,7 +39,7 @@ The following code example shows the rendering of built-in Syncfusion The `Size` property is applicable only when defining the icon using `Name` pr ### Icon appearance customization -The [SfIcon](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.SfIcon.html) supports to customize color and size by overriding the `e-icons` class. +The [SfIcon](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.SfIcon.html) supports customizing color and size by overriding the `e-icons` class. The following example code demonstrates the custom font-size and color for icons. @@ -119,7 +119,7 @@ The following example code demonstrates the custom font-size and color for icons ![Blazor Icon Component Customization](./images/icons/custom-icon.png) -### Third party icons integration +### Third‑party icons integration The [SfIcon](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.SfIcon.html) supports to render custom font icons using the [IconCss](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Buttons.SfIcon.html#Syncfusion_Blazor_Buttons_SfIcon_IconCss) property. To render custom font icons define the required font CSS that provides the required font name, font size, and content for the icon. @@ -127,6 +127,8 @@ The following code explains how to render `open-iconic` icons using `IconCss` pr Include the stylesheet reference in the `` section of the **~/App.razor** file as shown below: +Example link tag: + ```html .... @@ -183,9 +185,9 @@ The following example shows how to integrate the icons with Syncfusion® icons can be rendered directly in the HTML element by defining `e-icons` class that contains the font-family and common property of font icons, and defining the [available icon's](#icons-list) class with `e-` prefix. +Built-in Syncfusion® icons can be rendered directly in an HTML element by adding the `e-icons` class (font family and common properties) and the [available icon](#icons-list) class with the `e-` prefix. The following code example explains the direct rendering of Syncfusion® `search` icon in the span element. diff --git a/blazor/appearance/images/colorpicker.png b/blazor/appearance/images/colorpicker.png index 7f997e9b64..92d34bef16 100644 Binary files a/blazor/appearance/images/colorpicker.png and b/blazor/appearance/images/colorpicker.png differ diff --git a/blazor/appearance/images/customized.png b/blazor/appearance/images/customized.png index 7fd54b90f8..4ad8266a4a 100644 Binary files a/blazor/appearance/images/customized.png and b/blazor/appearance/images/customized.png differ diff --git a/blazor/appearance/images/download-icon.png b/blazor/appearance/images/download-icon.png index 89a14757a6..4148249e75 100644 Binary files a/blazor/appearance/images/download-icon.png and b/blazor/appearance/images/download-icon.png differ diff --git a/blazor/appearance/images/filter-customized.png b/blazor/appearance/images/filter-customized.png index 6eb7be7989..1196cc83e7 100644 Binary files a/blazor/appearance/images/filter-customized.png and b/blazor/appearance/images/filter-customized.png differ diff --git a/blazor/appearance/images/filter-icon.png b/blazor/appearance/images/filter-icon.png index 91f8da18be..25861f8660 100644 Binary files a/blazor/appearance/images/filter-icon.png and b/blazor/appearance/images/filter-icon.png differ diff --git a/blazor/appearance/images/import-icon.png b/blazor/appearance/images/import-icon.png index 23d963b1d9..56135eb179 100644 Binary files a/blazor/appearance/images/import-icon.png and b/blazor/appearance/images/import-icon.png differ diff --git a/blazor/appearance/images/two-pane.png b/blazor/appearance/images/two-pane.png index 530de391db..6381a8df75 100644 Binary files a/blazor/appearance/images/two-pane.png and b/blazor/appearance/images/two-pane.png differ diff --git a/blazor/appearance/size-modes.md b/blazor/appearance/size-modes.md index d617a97959..800fe28c6e 100644 --- a/blazor/appearance/size-modes.md +++ b/blazor/appearance/size-modes.md @@ -1,19 +1,20 @@ --- layout: post -title: Component Size Modes in Blazor - Syncfusion -description: Check out and learn here all about component size mode for Syncfusion Blazor Components and much more. +title: Size modes for Blazor components - Syncfusion +description: Learn here how to enable touch-friendly sizing with the .e-bigger class in Syncfusion Blazor, apply it app-wide or per component, and toggle at runtime. platform: Blazor -component: Appearance +control: Appearance documentation: ug --- -# Size Mode for Blazor Components +# Size modes for Syncfusion® Blazor components -Syncfusion® Blazor components supports touch (bigger theme) and normal size modes. The following topics explain how to enable the same in your application. +Syncfusion® Blazor components support two size modes: normal and touch (bigger theme). The following sections show how to enable them. -## Size mode for application +## Size mode for the application + +You can enable touch mode (bigger theme) for an application by adding the `.e-bigger` class in your app stylesheet (`~/wwwroot/css/app.css or site.css`) and applying it to the `body` element. -You can enable touch mode (bigger theme) for an application by adding `.e-bigger` class in `~/wwwroot/css/app.css or site.css` file ou your Blazor App and assign to the `body` as follows, * For **Blazor Web App**, assign `.e-bigger` class to `body` element of **~/Components/App.razor** file. * For **Blazor WebAssembly application**, assign `.e-bigger` class to `body` element of **wwwroot/index.html** file. * For **Blazor Server application**, assign `.e-bigger` class to `body` element of @@ -37,11 +38,11 @@ You can enable touch mode (bigger theme) for an application by adding `.e-bigger ``` -## Size mode for a control +## Size mode for a component You can enable touch mode (bigger theme) for a control by adding `.e-bigger` class and assign to the `div` which contains the control. -If you create Blazor web App with interactivity location as `Per page/component`, make ensure the define a render mode at the top of the Syncfusion® Blazor Component included page, as follows: +If the Blazor Web App uses interactivity location `Per page/component`, ensure a render mode is defined at the top of the page that includes the Syncfusion® Blazor component, as follows: {% tabs %} {% highlight razor %} @@ -85,7 +86,7 @@ If you create Blazor web App with interactivity location as `Per page/component` ``` -## Change size mode for application at runtime +## Change size mode for the application at runtime You can change the size mode of an application between touch and normal (mouse) mode at runtime by adding and removing `.e-bigger` using `JavaScriptInterop`. @@ -99,7 +100,10 @@ Follow below steps to change the size mode for an application at runtime. } ``` -2. Add the following JavaScript methods inside the script tag of `~/Components/App.razor`(Blazor Web App) or `wwwroot/index.html` (Blazor WebAssembly App) or `Pages/_Host.cshtml` (Blazor Server App) to switch between touch and mouse mode using `e-bigger` class. +2. Add the following JavaScript methods to switch between touch and mouse modes using the `e-bigger` class. Place the script in the appropriate file: + - Blazor Web App: `~/Pages/_Layout.cshtml` + - Blazor WebAssembly App: `~/wwwroot/index.html` + - Blazor Server App: `~/Pages/_Host.cshtml` ```cshtml ``` -3. Run the application and it will load the resources with application required components. +3. Run the application. The resources will load only the required components. + +N> Ensure the generated bundle version matches the installed Syncfusion Blazor NuGet package version. After upgrading packages, regenerate the CRG bundle. For reference on where to place script references, see [Reference script files for Syncfusion Blazor](https://blazor.syncfusion.com/documentation/common/adding-script-references). ## Import previously generated settings into CRG -To add more components or upgrade the latest Syncfusion® Blazor library resources, it is not necessary to generate from the scratch in the CRG. Just import the old **import.json** file, make the changes, and then download it again from the CRG application. +To add more components or update to the latest Syncfusion® Blazor resources, it is not necessary to start from scratch. Import the existing **import.json**, make changes, and download it again from the CRG application. -Refer to the following steps to import previous settings in CRG: +Follow these steps to import previous settings in CRG: -1. Click the **IMPORT SETTINGS** button at the bottom of the page. -![Import option in CRG](images/import-option.png) -2. Upload the **import.json** file, so that the previously stored data will be restored in the CRG application. Now, add more components and export the resources again. -![blazor Previous changes restored](images/previous-changes-restored.png) +1. Click **IMPORT SETTINGS** at the bottom of the page. +![CRG import settings action](images/import-option.png) +2. Upload the **import.json** file to restore the previous configuration. Add components as needed and export the resources again. +![CRG with previously restored selections](images/previous-changes-restored.png) diff --git a/blazor/common/data-binding/data-updates.md b/blazor/common/data-binding/data-updates.md index 4f93487908..b12c053a82 100644 --- a/blazor/common/data-binding/data-updates.md +++ b/blazor/common/data-binding/data-updates.md @@ -1,21 +1,21 @@ --- layout: post -title: Observable Collection and INotifyPropertyChanged in Syncfusion Blazor -description: Check out the documentation for the Observable Collection support in the Syncfusion Blazor Components. +title: ObservableCollection and INotifyPropertyChanged in Syncfusion Blazor +description: Learn how Syncfusion Blazor components react to changes from ObservableCollection and INotifyPropertyChanged without manual refresh. Explore to more details. platform: Blazor component: Common documentation: ug --- -# Observable Collection and INotifyPropertyChanged in Blazor +# Data updates with Interface -Syncfusion® Blazor components supports to automatically update data based on `INotifyCollectionChanged` (`ObservableCollection`) and `INotifyPropertyChanged` interfaces. +Syncfusion® Blazor components automatically update UI when bound data implements `INotifyCollectionChanged` (`ObservableCollection`) or `INotifyPropertyChanged`. -## Observable Collection +## ObservableCollection -The data-bound components (like DataGrid, Kanban, Scheduler) provides support to update its data without any additional refresh call when using `ObservableCollection` as data source and perform add, remove, clear actions in collection. ObservableCollection notifies the collection changes using [INotifyCollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.inotifycollectionchanged?view=net-7.0) interface. +Data-bound components (such as DataGrid, Kanban, Scheduler) provides support to update its data without any additional refresh call when using `ObservableCollection` as data source and perform add, remove, clear actions in collection. ObservableCollection notifies the collection changes using [INotifyCollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.inotifycollectionchanged) interface. -In the following code example, DataGrid automatically updates its data when add, remove items in the `ObservableCollection`. +In the following example, the DataGrid updates automatically when items are added to or removed from the `ObservableCollection`. ```cshtml @using System.Collections.ObjectModel; @@ -104,9 +104,9 @@ In the following code example, DataGrid automatically updates its data when add, ## INotifyPropertyChanged -The data-bound components (like DataGrid, Kanban, Scheduler) provides support to update its data without any additional refresh call when changing property value of item if an item implements [INotifyPropertyChanged ](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=net-7.0) interface. `INotifyPropertyChanged` interface is used to notify, that a property value has changed. +Data-bound components (such as DataGrid, Kanban, and Scheduler) provides support to update its data without any additional refresh call when changing property value of item if an item implements [INotifyPropertyChanged ](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged) interface. `INotifyPropertyChanged` interface is used to notify, that a property value has changed. -In the below example, `DataOrder` implements `INotifyPropertyChanged` interface and raises a [PropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged?view=net-7.0) event when property values are changed. DataGrid automatically updates its property values are changed in data object by listening to `PropertyChanged` event. +In the following example, the `DataOrder` type implements `INotifyPropertyChanged` and raises the [PropertyChanged](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged.propertychanged) event when a property value changes. DataGrid automatically updates its property values are changed in data object by listening to `PropertyChanged` event. ```cshtml @using System.Collections.ObjectModel; diff --git a/blazor/common/data-binding/restful-service-binding.md b/blazor/common/data-binding/restful-service-binding.md index 9c6fba2f4d..d9c606d09d 100644 --- a/blazor/common/data-binding/restful-service-binding.md +++ b/blazor/common/data-binding/restful-service-binding.md @@ -1,25 +1,24 @@ --- layout: post -title: "Bind data from RESTful web services to Syncfusion Blazor components" -component: "General" -description: "Learn how to retrieve data from RESTful service, bind it to Syncfusion DataGrid component using ODataV4Adaptor of SfDataManager, and perform CRUD operations." +title: Bind data from web services to Syncfusion Blazor components +description: Learn how to retrieve data from a RESTful service, bind it to Syncfusion Blazor DataGrid using SfDataManager with ODataV4Adaptor, and perform CRUD operations. platform: Blazor -component: Common +control: Common documentation: ug --- -# Bind Data from RESTful Web Services to Syncfusion® Blazor Components +# Bind data from RESTful web services to Syncfusion® Blazor components -In this topic, you can learn how to retrieve data from RESTful web services, bind data to a Grid component, and perform CRUD operations. Here, data is fetched from the ODataV4 service using [ODataV4Adaptor](https://blazor.syncfusion.com/documentation/data/adaptors#odatav4-adaptor) of `SfDataManger`. +This article shows how to retrieve data from a RESTful web services, bind it to the Grid component, and perform CRUD operations. Data is fetched from an ODatav4 service using the [ODataV4Adaptor](https://blazor.syncfusion.com/documentation/data/adaptors#odatav4-adaptor) of `SfDataManager`. -It is recommended to choose the suitable adaptor based on the RESTful service which you are using to bind data for the Syncfusion® Blazor component. Refer to the following documentation to know about the available Adaptors of SfDataManager. +Choose the suitable adaptor based on the RESTful service which you are using to bind data for the Syncfusion® Blazor component. Refer to the following documentation to know about the available Adaptors of SfDataManager. * [Adaptors](https://blazor.syncfusion.com/documentation/data/adaptors) ## Prerequisite software -The following software are needed -* Visual Studio 2022. -* .NET 6.0 or later. +The following software are required: +* Visual Studio 2022 +* .NET 6.0 or later ## Create the database @@ -53,7 +52,7 @@ Now, click on **Update Database**. ## Create OData service project -Open Visual Studio 2022 and create an empty ASP.NET Core Web Application and name it as ODataServiceProject. After creating the application, install [Microsoft.AspNetCore.OData](https://www.nuget.org/packages/Microsoft.AspNetCore.OData/) package by running the following command in the Package Manager Console. +Open Visual Studio 2022 and create an empty ASP.NET Core Web Application named ODataServiceProject. After creating the application, install the [Microsoft.AspNetCore.OData](https://www.nuget.org/packages/Microsoft.AspNetCore.OData/) package by running the following command in the Package Manager Console. ``` Install-Package Microsoft.AspNetCore.OData @@ -322,19 +321,19 @@ app.Run(); ## Create Blazor Web App -You can create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). +Create a **Blazor Web App** using Visual Studio 2022 via [Microsoft templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). -You need to configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=windows) while creating a Blazor Web Application. +Configure the appropriate [interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes#render-modes) and [interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling#interactivity-location) when creating the Blazor Web App. ## Create Blazor Server Application -You can create a **Blazor Server App** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). +Create a **Blazor Server App** using Visual Studio via [Microsoft templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). ## Add Syncfusion® Blazor Grid and Themes NuGet in Blazor App To add **Blazor DataGrid** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.Grid](https://www.nuget.org/packages/Syncfusion.Blazor.Grid/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). -If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Syncfusion® Blazor components NuGet packages within the client project. +If using `WebAssembly` or `Auto` render modes in a Blazor Web App, install Syncfusion® Blazor NuGet packages in the client project. Alternatively, you can utilize the following package manager command to achieve the same. @@ -380,12 +379,11 @@ Themes provide life to components. Syncfusion®` of **~/Components/App.razor** file for .NET 9 and .NET 8. - - * For **Blazor WebAssembly application**, refer stylesheet inside the `` element of **wwwroot/index.html** file. - * For **Blazor Server application**, refer stylesheet inside the `` element of + * For **Blazor Web App**, reference the stylesheet inside the `` of **~/Pages/_Layout.cshtml**. + * For **Blazor WebAssembly App**, reference the stylesheet inside the `` of **~/wwwroot/index.html**. + * For **Blazor Server App**, reference the stylesheet inside the `` of * **~/Pages/_Host.cshtml** file for .NET 7. * **~/Pages/_Layout.cshtml** file for .NET 6. @@ -431,7 +429,7 @@ If you have set the interactivity location to `Per page/component` in the web ap ## Binding data to Blazor DataGrid component using ODataV4Adaptor -To consume data from the OData Controller, you need to add the **SfDataManager** with **ODataV4Adaptor**. Refer to the following documentation for more details on ODataV4Adaptor. +To consume data from the OData controller, add **SfDataManager** with **ODataV4Adaptor**. Refer to the following documentation for more details on ODataV4Adaptor. [ODataV4Adaptor](https://blazor.syncfusion.com/documentation/data/adaptors#odatav4-adaptor) @@ -445,7 +443,7 @@ To consume data from the OData Controller, you need to add the **SfDataManager** {% endhighlight %} {% endtabs %} -N> In the above code example, we have used our localhost address from our application. Instead of localhost, you can give the exact URL of your OData service. +N> In the example above, a localhost URL is used. Replace it with the actual URL of your OData service. Grid columns can be defined by using the [GridColumn](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html) component. We are going to create columns using the following code. @@ -505,9 +503,9 @@ public class OrdersController : ODataController ## Handling CRUD operations with our Syncfusion® Blazor DataGrid component -You can enable editing in the grid component using the [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html) component. Grid provides various modes of editing options such as [Inline/Normal](https://blazor.syncfusion.com/documentation/datagrid/in-line-editing), [Dialog](https://blazor.syncfusion.com/documentation/datagrid/dialog-editing), and [Batch](https://blazor.syncfusion.com/documentation/datagrid/batch-editing) editing. +Enable editing in the grid component using [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html). The Grid supports several editing modes: [Inline/Normal](https://blazor.syncfusion.com/documentation/datagrid/in-line-editing), [Dialog](https://blazor.syncfusion.com/documentation/datagrid/dialog-editing), and [Batch](https://blazor.syncfusion.com/documentation/datagrid/batch-editing). -Here, we are using **Inline** edit mode and used Toolbar property to show toolbar items for editing. +Here, Inline edit mode is used with the Toolbar to show editing actions. We have added the DataGrid Editing and Toolbar code with previous Grid model. {% tabs %} @@ -540,7 +538,7 @@ We have added the DataGrid Editing and Toolbar code with previous Grid model. {% endhighlight %} {% endtabs %} -N> Normal editing is the default edit mode for the DataGrid component. Set the [IsPrimaryKey](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsPrimaryKey) property of Column as **true** for a particular column, whose value is a unique value for editing purposes. +N> Normal editing is the default mode. Set the [IsPrimaryKey](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsPrimaryKey) property to **true** for the column that holds a unique key. ### Insert a row @@ -609,4 +607,4 @@ public long Delete([FromODataUri] long key) {% endhighlight %} {% endtabs %} -N> Find the sample from this [Github](https://github.com/SyncfusionExamples/binding-odata-services-and-perform-crud) location. +N> Find the sample at this [GitHub repository](https://github.com/SyncfusionExamples/binding-odata-services-and-perform-crud). diff --git a/blazor/common/data-binding/two-way-binding.md b/blazor/common/data-binding/two-way-binding.md index 6c0a3e6a75..a984a7cd72 100644 --- a/blazor/common/data-binding/two-way-binding.md +++ b/blazor/common/data-binding/two-way-binding.md @@ -1,17 +1,17 @@ --- layout: post -title: Two-way Data Binding in Blazor | Syncfusion -description: Check out the documentation for the two-way data binding support in the Syncfusion Blazor Components. +title: Two-way data binding in Blazor | Syncfusion +description: Learn here all about how Syncfusion Blazor components use the two-way data binding with @bind-Value and related patterns. Explore here to more details. platform: Blazor -component: Common +control: Common documentation: ug --- -# Blazor - Two-way Data Binding +# Two-way data binding Syncfusion® Blazor components provide data binding features with the `@bind-value` Razor directive attribute with a field, property, or Razor expression value. By default, the `bind-value` attribute binds the data value in the `OnChange` event. The `OnChange` event triggers when the element loses its focus. -To perform a two-way binding Syncfusion® Blazor components, use the `bind-Value` attribute. In the below example, `SfTextBox` component value to the C# `textValue` property. When an `SfTextBox` component loses focus, its bound field or property is updated. +To enable two-way binding on Syncfusion® components, use `@bind-Value`. In the following example, the `SfTextBox` component is bound to the C# `textValue` property. When the textbox loses focus, the bound field is updated. ```cshtml @@ -32,7 +32,7 @@ To perform a two-way binding Syncfusion® Bl ``` -![Two-Way Binding in Blazor](../images/blazor-two-way-binding.gif) +![Two-way data binding example in Blazor](../images/blazor-two-way-binding.gif) The following Syncfusion® Blazor components support two-way binding: @@ -52,9 +52,9 @@ The following Syncfusion® Blazor components * [TextBox](https://blazor.syncfusion.com/documentation/textbox/data-binding) * [TimePicker](https://blazor.syncfusion.com/documentation/timepicker/data-binding) -## Bind component generated dynamically using RenderFragment +## Bind a component generated dynamically using RenderFragment -You can build Blazor render trees manually with `RenderTreeBuilder` which provides methods for building and manipulating components manually in C# code. The following code explains how to bind value for `DatePicker` component which is generated dynamically using `RenderFragment`. Refer sequence 3,4 where binding and call back is handled. +Blazor render trees can be built manually with `RenderTreeBuilder`, which provides methods for creating and configuring components in C# code. The following example shows how to bind a value for a `DatePicker` component generated via `RenderFragment`. See steps 3 and 4 where the value binding and callback are handled. ```cshtml @@ -95,6 +95,6 @@ You can build Blazor render trees manually with `RenderTreeBuilder` which provid } ``` -![Binding in Blazor when build a render tree](../images/blazor-date-picker.png) +![Binding a dynamically generated Blazor DatePicker using RenderFragment](../images/blazor-date-picker.png) -Refer [Manually build a render tree](https://docs.microsoft.com/en-us/aspnet/core/blazor/advanced-scenarios?#manually-build-a-render-tree-rendertreebuilder) topic for more details. +For more information, see the Blazor documentation on [manually building a render tree](https://docs.microsoft.com/en-us/aspnet/core/blazor/advanced-scenarios?#manually-build-a-render-tree-rendertreebuilder). diff --git a/blazor/common/data-binding/webapi-service-binding.md b/blazor/common/data-binding/webapi-service-binding.md index b7b4b18b4f..fa77e81095 100644 --- a/blazor/common/data-binding/webapi-service-binding.md +++ b/blazor/common/data-binding/webapi-service-binding.md @@ -1,14 +1,15 @@ --- layout: post title: Bind data to Blazor components using WebApiAdaptor | CRUD | Syncfusion -description: Learn how to retrieve data from WebApi controller, bind it to the Syncfusion DataGrid component using WebApiAdaptor of DataManager, and perform CRUD operations. -component: General +description: Learn how to retrieve data from a Web API, bind it to the Syncfusion Blazor DataGrid using SfDataManager with WebApiAdaptor, and perform CRUD operations. platform: Blazor +control: Common +documentation: ug --- # Bind data to Blazor components using WebApiAdaptor and perform CRUD -In this topic, you can learn how to retrieve data from WebApi Controller, bind to Grid component using [WebApiAdaptor](https://blazor.syncfusion.com/documentation/data/adaptors#web-api-adaptor) of `SfDataManger`, and perform CRUD operations. +This article shows how to retrieve data from a WebAPI controller, bind it to the DataGrid using the [WebApiAdaptor](https://blazor.syncfusion.com/documentation/data/adaptors#web-api-adaptor) of `SfDataManager`, and perform CRUD operations. You can use the WebApiAdaptor of SfDataManager to interact with Web APIs created with OData endpoint. The WebApiAdaptor is extended from the ODataAdaptor. Hence, to use WebApiAdaptor, the endpoint should understand the OData formatted queries sent along with the request. @@ -16,9 +17,9 @@ To enable the OData query option for Web API, Refer to this [documentation](http ## Prerequisite software -The following software are needed +The following software are required: * Visual Studio 2022 -* .NET 7.0 or .NET 8.0 or .NET 9.0. +* .NET 7.0 or .NET 8.0 or .NET 9.0 ## Create the database @@ -52,9 +53,9 @@ Now, click on **Update Database**. ## Create a new Blazor Web App -You can create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). +Create a **Blazor Web App** using Visual Studio 2022 via [Microsoft templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). -You need to configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=windows) while creating a Blazor Web Application. +Configure the appropriate [interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes#render-modes) and [interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling#interactivity-location) when creating the Blazor Web App. ### Generate DbContext and model class from the database @@ -424,7 +425,7 @@ app.Run(); To add **Blazor DataGrid** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.Grid](https://www.nuget.org/packages/Syncfusion.Blazor.Grid/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). -If you utilize `WebAssembly or Auto` render modes in the Blazor Web App need to be install Syncfusion® Blazor components NuGet packages within the client project. +If using `WebAssembly` or `Auto` render modes in a Blazor Web App, install Syncfusion® Blazor NuGet packages in the client project. Alternatively, you can utilize the following package manager command to achieve the same. @@ -469,12 +470,11 @@ Themes provide life to components. Syncfusion®` of **~/Components/App.razor** file for .NET 9 and .NET 8. - - * For **Blazor WebAssembly application**, refer stylesheet inside the `` element of **wwwroot/index.html** file. - * For **Blazor Server application**, refer stylesheet inside the `` element of +* For **Blazor Web App**, refer stylesheet inside the `` of **~/Components/App.razor** file for .NET 9 and .NET 8. +* For **Blazor WebAssembly application**, refer stylesheet inside the `` element of **wwwroot/index.html** file. +* For **Blazor Server application**, refer stylesheet inside the `` element of * **~/Pages/_Host.cshtml** file for .NET 7. * **~/Pages/_Layout.cshtml** file for .NET 6. @@ -516,7 +516,7 @@ If you have set the interactivity location to `Per page/component` in the web ap {% endhighlight %} {% endtabs %} -## Binding data to Blazor DataGrid component using WebApiAdaptor +## Bind data to the Blazor DataGrid using WebApiAdaptor To consume data from the WebApi Controller, you need to add the **SfDataManager** with **WebApiAdaptor**. Refer to the following documentation for more details on [WebApiAdaptor](https://blazor.syncfusion.com/documentation/data/adaptors#web-api-adaptor). @@ -617,7 +617,7 @@ We have added the DataGrid Editing and Toolbar code with previous Grid model. {% endhighlight %} {% endtabs %} -N> Normal editing is the default edit mode for the DataGrid component. Set the [IsPrimaryKey](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsPrimaryKey) property of Column as **true** for a particular column, whose value is a unique value for editing purposes. +N> Normal editing is the default mode. Set the [IsPrimaryKey](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsPrimaryKey) property to **true** for the column that holds a unique key. ### Insert a row @@ -683,4 +683,4 @@ public void Delete(long id) {% endhighlight %} {% endtabs %} -N> Find the sample from this [Github](https://github.com/SyncfusionExamples/binding-webapi-services-and-perform-crud) location. +N> Find the sample at this [GitHub repository](https://github.com/SyncfusionExamples/binding-webapi-services-and-perform-crud). diff --git a/blazor/common/deployment.md b/blazor/common/deployment.md index d0b1254d38..1b708f5df9 100644 --- a/blazor/common/deployment.md +++ b/blazor/common/deployment.md @@ -1,17 +1,17 @@ --- layout: post -title: Deployment in Blazor | AOT | Syncfusion -description: Learn here all about deploying the Blazor application with Syncfusion Blazor Components and much more. +title: Publish and Deploy in Blazor | AOT | Syncfusion +description: Learn how to publish and deploy Blazor Web App, Blazor WASM, Blazor Server Apps with Syncfusion Blazor components, including self-contained deployment and AOT. platform: Blazor component: Common documentation: ug --- -# Deployment in Blazor +# Publish and Deploy in Blazor -This section provides information about deploying Blazor applications with the Syncfusion® Blazor components. +This section provides information about publishing and deploying Blazor applications with the Syncfusion Blazor components. -Refer to [Host and deploy ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-7.0&tabs=visual-studio) topic for more information. +For more information, see [Host and deploy ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy). ## Publish Blazor Application with Visual Studio @@ -59,7 +59,7 @@ dotnet publish -c Release --self-contained true -r win-x86 {% endhighlight %} {% endtabs %} -Refer to the [dotnet publish - arguments](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish?tabs=netcore21#arguments) to learn about various optional arguments. Use the following command to specify the path for the output directory. +Refer to [dotnet publish arguments](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#arguments) to learn about optional arguments. Use the following command to specify the output directory path. {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -75,7 +75,7 @@ If the path is relative, the output directory generated is relative to the proje ## Ahead-of-time (AOT) compilation in Blazor WebAssembly -Blazor WebAssembly supports ahead-of-time (AOT) compilation which provides improved runtime performance at the expense of a larger app size. Refer to [Ahead-of-time (AOT) compilation](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-6.0#ahead-of-time-aot-compilation) topic to learn more about how it works and how to enable. +Blazor WebAssembly supports ahead-of-time (AOT) compilation, which improves runtime performance at the expense of a larger app size. For details and enable steps, see [Ahead-of-time (AOT) compilation](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly#ahead-of-time-aot-compilation). ### Enable AOT in the application @@ -93,10 +93,10 @@ To enable AOT compilation in the application, add `RunAOTCompilation` options wi ## See also -* [Host and Deploy Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-7.0&tabs=visual-studio) -* [Host and deploy Blazor Server](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server?view=aspnetcore-7.0) -* [Host and deploy ASP.NET Core Blazor WebAssembly](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-7.0) -* [Publish a Web app to Azure App Service using Visual Studio](https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-aspnet-web-app?view=vs-2022&tabs=azure) -* [Deploy ASP.NET Core apps to Azure App Service](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/?view=aspnetcore-7.0&tabs=visual-studio) -* [Deploy Blazor WASM App to Cloudflare](https://www.syncfusion.com/blogs/post/easily-deploy-a-blazor-webassembly-app-to-cloudflare.aspx) -* [Publish a Blazor WebAssembly app and .NET API with Azure Static Web Apps](https://learn.microsoft.com/en-us/training/modules/publish-app-service-static-web-app-api-dotnet/) +* [Host and deploy Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy) +* [Host and deploy Blazor Server](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server/) +* [Host and deploy ASP.NET Core Blazor WebAssembly](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly) +* [Publish a Web App to Azure App Service using Visual Studio](https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-aspnet-web-app?view=vs-2022&tabs=azure) +* [Deploy ASP.NET Core apps to Azure App Service](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps) +* [Deploy Blazor WASM App to Cloudflare](https://www.syncfusion.com/blogs/post/easily-deploy-a-blazor-webassembly-app-to-cloudflare) +* [Publish a Blazor WebAssembly App and .NET API with Azure Static Web Apps](https://learn.microsoft.com/en-us/training/modules/publish-app-service-static-web-app-api-dotnet/) diff --git a/blazor/common/extend-and-customize-components.md b/blazor/common/extend-and-customize-components.md index 30a41622ee..2a331ccfd7 100644 --- a/blazor/common/extend-and-customize-components.md +++ b/blazor/common/extend-and-customize-components.md @@ -1,19 +1,19 @@ --- layout: post -title: Extend and Customize the Syncfusion Components in Blazor - Syncfusion -description: Checkout and learn here about how to extend, customize, and reuse the Syncfusion Components in Blazor +title: Extend and customize Syncfusion Blazor components - Syncfusion +description: Learn how to extend, compose, and reuse Syncfusion Blazor components, including dynamic rendering patterns. platform: Blazor -component: Common +control: Common documentation: ug --- # Extend, Customize, and Reuse Components -The Blazor framework provides the support to extend a component or customize it within another component for a strong composite model. +Blazor framework provides the support to extend a component or customize it within another component for a strong composite model. ## Extend Syncfusion® Blazor component -The Syncfusion® Blazor components can extend and customize the logic by creating a new Blazor component. +Syncfusion® Blazor components can be extended by creating a new Razor component and implementing custom logic. 1. Right-click on the `~/Pages` folder in the Visual Studio and select `Add -> Razor Component` to create a new Razor component (SyncButton.razor). @@ -82,11 +82,11 @@ The Syncfusion® Blazor components can exten ``` - ![Output of extending Syncfusion component](images/extend-sync-component.png) + ![Output of extending a Syncfusion Blazor component example](images/extend-sync-component.png) ## Use Syncfusion® Blazor component within another Blazor component -The Syncfusion® Blazor component can be implemented within another Blazor component. +A Syncfusion® Blazor component can be implemented within another Razor component. 1. Right-click on the `~/Pages` folder in the Visual Studio and select `Add -> Razor Component` to create a new Razor component (TodoList.razor). @@ -154,21 +154,21 @@ The Syncfusion® Blazor component can be imp ``` - ![Render Syncfusion Blazor components inside another Blazor component](images/todolist.gif) + ![Render Syncfusion Blazor components within another component](images/todolist.gif) ## Render Syncfusion® Blazor component dynamically The following methods can be used to render the Syncfusion® Blazor components dynamically: -1. [RenderFragment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.renderfragment?view=aspnetcore-8.0) with [Razor Template Syntax](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-8.0#razor-templates) -2. [RenderFragment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.renderfragment?view=aspnetcore-8.0) with [RenderTreeBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendering.rendertreebuilder?view=aspnetcore-8.0) methods -3. [BuildRenderTree](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase.buildrendertree?view=aspnetcore-7.0) method +1. [RenderFragment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.renderfragment) with [Razor template syntax](https://learn.microsoft.com/en-us/aspnet/core/blazor/components#razor-templates) +2. [RenderFragment](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.renderfragment) with [RenderTreeBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendering.rendertreebuilder) methods +3. [BuildRenderTree](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase.buildrendertree) method ### RenderFragment with Razor Syntax The `RenderFragment` represents the segments of UI content that can be reused in the view page based on the application logic. -You can use [Razor Template Syntax](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-8.0#razor-templates) to define the `RenderFragment` in the view page. +You can use [Razor template syntax](https://learn.microsoft.com/en-us/aspnet/core/blazor/components#razor-templates) to define the `RenderFragment` in the view page. The following code demonstrates the RenderFragment that renders the `SfButton` component. @@ -212,9 +212,9 @@ The following code demonstrates the RenderFragment that renders the `SfGrid` com ## RenderFragment with RenderTreeBuilder methods -You can define the RenderFragment delegate with [RenderTreeBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendering.rendertreebuilder?view=aspnetcore-8.0)'s methods. +You can define the RenderFragment delegate with [RenderTreeBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendering.rendertreebuilder) methods. -N> Refer to [Manual RenderTreeBuilder logic](https://learn.microsoft.com/en-us/aspnet/core/blazor/advanced-scenarios?view=aspnetcore-8.0#manual-rendertreebuilder-logic) to know more about RenderTreeBuilder. +N> Refer to [Manual RenderTreeBuilder logic](https://learn.microsoft.com/en-us/aspnet/core/blazor/advanced-scenarios#manual-rendertreebuilder-logic) to learn more about RenderTreeBuilder. ```cshtml @RenderSfButton() @@ -295,7 +295,7 @@ You can create a simple Blazor component with the `BuildRenderTree` method and g 1. Right-click on the `~/Pages` folder in the Visual Studio and select `Add -> Class` to create a new class file (SyncTextBox.cs). -2. Inherit the newly created class with [ComponentBase](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase?view=aspnetcore-7.0) and override the [BuildRenderTree](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase.buildrendertree?view=aspnetcore-7.0) method to create the component. +2. Inherit the newly created class with [ComponentBase](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase) and override the [BuildRenderTree](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase.buildrendertree) method to create the component. ```c# using Microsoft.AspNetCore.Components; diff --git a/blazor/common/globalization.md b/blazor/common/globalization.md index 9a10e9eaa5..207a55ae0c 100644 --- a/blazor/common/globalization.md +++ b/blazor/common/globalization.md @@ -1,40 +1,37 @@ --- layout: post title: Globalization in Blazor - Syncfusion -description: Learn here all about how globalization support in Syncfusion Blazor component, it's elements and more. +description: Learn how Syncfusion Blazor components handle globalization for numbers, dates, times, and currencies across cultures in Blazor Web App, WASM, and Server App. platform: Blazor -component: Common +control: Common documentation: ug --- # Globalization in Blazor Application -Globalization is the combination of adapting the control to various languages by parsing and formatting the dates, times, numbers or currencies (`Internationalization (L18N)`) and adding cultural-specific customizations and translating the text (`Localization (L10N)`). +Globalization combines internationalization (i18n)—parsing and formatting dates, times, numbers, and currencies—and localization (l10n)—adding culture-specific customizations and translating UI text. -The Syncfusion® Blazor UI components are specific to the `American English (en-US)` culture by default. It utilizes the `Blazor Internationalization` package to parse and format the number and date objects based on the chosen culture. +The Syncfusion® Blazor UI components use American English (`en-US`) by default. Blazor relies on .NET globalization to parse and format numbers and dates based on the active culture. In Blazor WebAssembly, ensure globalization data is available when using non‑en cultures. -Blazor uses the built-in .NET types from the `System.Globalization` namespace, such as the `CultureInfo` class and its `CurrentCulture` property. +Blazor uses built-in .NET types from the System.Globalization namespace, such as the CultureInfo class and its culture properties. -* Culture ([CultureInfo.CurrentCulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentculture?view=net-8.0#system-globalization-cultureinfo-currentculture)): Determines the formatting of numbers, dates, and times. It's mainly concerned with how data is presented and interpreted. -* UI Culture ([CultureInfo.CurrentUICulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture?view=net-8.0#system-globalization-cultureinfo-currentuiculture)): Determines the language of the user interface, including which resource files (like .resx files) are used for localizing the app’s UI. +* Culture ([CultureInfo.CurrentCulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentculture?view=net-8.0#system-globalization-cultureinfo-currentculture)): Determines the formatting of numbers, dates, and times. +* UI culture ([CultureInfo.CurrentUICulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture?view=net-8.0#system-globalization-cultureinfo-currentuiculture)): Determines the language of the user interface and which .resx resources are used. -When dealing with form fields in Blazor, it’s important to note that certain input types automatically respect the user's culture settings using [CultureInfo.InvariantCulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.invariantculture?view=net-8.0#system-globalization-cultureinfo-invariantculture). - -For example, the following input types are culture-sensitive: +When working with HTML form fields, browser-native input types affect culture behavior: * `date` -* `number` +* `number` Blazor relies on the browser’s handling of these input types, which ensures that the user input is parsed and rendered according to their specific culture settings. -However, some form field types are not yet fully supported across all browsers, making them less reliable in Blazor applications. These include: +Input types are inconsistently supported across browsers and may be less reliable: * `datetime-local` * `month` * `week` - -The following code snippet serves as an example to demonstrate how globalization can be implemented in a Blazor application. It illustrates the process of localizing content, formatting dates and numbers. +The following example shows how globalization affects rendered values by formatting dates and numbers according to the current culture. {% tabs %} {% highlight razor %} @@ -62,11 +59,11 @@ The following code snippet serves as an example to demonstrate how globalization {% endhighlight %} {% endtabs %} -* Suppose, if you want to change any specific culture, then add the corresponding culture resource (`.resx`) file by using the below reference. +* To change any specific culture, add the corresponding `.resx` resource files and configure localization as described in the following article: -[Changing culture and Adding Resx file in the application](https://blazor.syncfusion.com/documentation/common/localization#how-to-enable-localization-in-blazor-application) +[Enable localization and add .resx files in the application](https://blazor.syncfusion.com/documentation/common/localization#how-to-enable-localization-in-blazor-application) ## See also * [ASP.NET Core Blazor globalization and localization](https://learn.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-8.0) -* [.NET Fundamentals: Globalization](https://learn.microsoft.com/en-us/dotnet/core/extensions/globalization) -* [.NET Fundamentals: Localization](https://learn.microsoft.com/en-us/dotnet/core/extensions/localization) +* [.NET fundamentals: Globalization](https://learn.microsoft.com/en-us/dotnet/core/extensions/globalization) +* [.NET fundamentals: Localization](https://learn.microsoft.com/en-us/dotnet/core/extensions/localization) diff --git a/blazor/common/how-to/add-blazor-component-on-existing-aspnet-core-mvc-app.md b/blazor/common/how-to/add-blazor-component-on-existing-aspnet-core-mvc-app.md index 0290fc1ef6..be0ad66b01 100644 --- a/blazor/common/how-to/add-blazor-component-on-existing-aspnet-core-mvc-app.md +++ b/blazor/common/how-to/add-blazor-component-on-existing-aspnet-core-mvc-app.md @@ -1,27 +1,27 @@ --- layout: post -title: Client Resources in Production Environment in Blazor - Syncfusion -description: Check out the documentation for Configure Syncfusion Blazor Client Resources in Production Environment in Blazor +title: Add Blazor component to an existing ASP.NET Core MVC App | Syncfusion +description: Learn how to integrate a Syncfusion Blazor component into an existing ASP.NET Core MVC application using the component tag helper and explore to more details. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to Add Blazor Component into Existing ASP.NET Core MVC Application +# Add a Blazor component to an existing ASP.NET Core MVC application -This section explains how to add Syncfusion® Blazor component on an existing ASP.NET Core MVC application. +This guide explains how to add a Syncfusion® Blazor component to an existing ASP.NET Core MVC application. -1. Open your existing ASP.NET Core MVC application on Visual Studio 2022. +1. Open the existing ASP.NET Core MVC application in Visual Studio 2022. -2. Right-click on the project and select `Manage NuGet Package`. +2. Right-click the project and select `Manage NuGet Packages`. ![Manage NuGet package on ASP.NET Core MVC app](images/asp-mvc-manage-nuget-package.png) -3. Search the `Syncfusion.Blazor.Grid` and `Syncfusion.Blazor.Themes` NuGet packages and install them. +3. Search for the `Syncfusion.Blazor.Grid` and `Syncfusion.Blazor.Themes` NuGet packages and install them. ![Installing Syncfusion Blazor Grid NuGet package](images/asp-mvc-install-nuget.png) -4. Register Blazor server service and Syncfusion® Blazor service in the `~/Program.cs` file. +4. Register Blazor Server and Syncfusion® Blazor services in the `~/Program.cs` file. ```c# using Syncfusion.Blazor; @@ -41,7 +41,7 @@ This section explains how to add Syncfusion®®` tag and Syncfusion® theme and script references inside the `` tag on `~/Views/Shared/_Layout.cshtml` file. +7. Add Blazor script references at the end of the `` tag and Syncfusion® theme and script references inside the `` tag in the `~/Views/Shared/_Layout.cshtml` file. ```cshtml @@ -73,9 +73,9 @@ This section explains how to add Syncfusion® ``` -8. Create a new folder `~/Components` at the root of application. Right-click on the `~/Components` folder and add a new razor component by `Add -> Razor Component`. +8. Create a new `~/Components` folder at the root of the application. Right-click the `~/Components` folder and add a new razor component via `Add -> Razor Component`. -9. Add the Syncfusion® Blazor component in the created razor file. +9. Add the Syncfusion® Blazor component in the created razor component file. ```cshtml @@ -112,7 +112,7 @@ This section explains how to add Syncfusion®® ``` -11. Run the application by pressing `F5` key. Now, the Syncfusion® Blazor Grid component will be rendered in the ASP.NET Core MVC application. +11. Run the application by pressing `F5`. The Syncfusion® Blazor Grid component is rendered in the ASP.NET Core MVC application. ![Syncfusion Blazor Grid component rendered on ASP.NET Core MVC application](images/asp-mvc-grid.png) ## See Also -* [Component Tag Helper in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/component-tag-helper?view=aspnetcore-7.0) -* [Integrating Blazor Components on Existing ASP.NET Core MVC apps](https://devblogs.microsoft.com/premier-developer/integrating-blazor-components-into-existing-asp-net-core-mvc-apps/) +* [Component Tag Helper in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/component-tag-helper) +* [Integrating Blazor components into existing ASP.NET Core MVC apps](https://devblogs.microsoft.com/premier-developer/integrating-blazor-components-into-existing-asp-net-core-mvc-apps/) diff --git a/blazor/common/how-to/add-blazor-component-to-the-toolbox.md b/blazor/common/how-to/add-blazor-component-to-the-toolbox.md index 0149d353e3..4bffcc612a 100644 --- a/blazor/common/how-to/add-blazor-component-to-the-toolbox.md +++ b/blazor/common/how-to/add-blazor-component-to-the-toolbox.md @@ -1,15 +1,15 @@ --- layout: post -title: Adding Blazor component to the toolbox - Syncfusion -description: Checkout and learn here all about the documentation for adding Syncfusion Blazor component to the toolbox in Blazor +title: Add Syncfusion Blazor components to the Toolbox | Syncfusion +description: Learn how to add the Syncfusion Blazor component snippets to the Visual Studio Toolbox in a Blazor project on Windows and explore here to more details. platform: Blazor -component: Common +control: Common documentation: ug --- # Add Syncfusion® Blazor components to the Visual Studio Toolbox -This section provides step-by-step guidance on how to add Syncfusion® Blazor components to the Visual Studio Toolbox. By default, the Toolbox displays HTML elements and Bootstrap snippets. To customize it for Blazor development, open the Toolbox by pressing `Ctrl + Alt + X` or by navigating to **View → Toolbox** from the top menu. +This guide explains how to add Syncfusion® Blazor component snippets to the Visual Studio Toolbox on Windows. By default, the Toolbox shows HTML elements and Bootstrap snippets. Open the Toolbox with Ctrl+Alt+X or navigate to **View → Toolbox**. To include Syncfusion® components for Blazor in the Toolbox, follow these steps: @@ -21,11 +21,12 @@ To include Syncfusion® components for Blazo ![Add code snippet to toolbox](images/add-snippet.gif) -3. Once the code snippet is added, the Toolbox will automatically assign it a default name based on the snippet content. -To improve clarity, right-click the item, select **Rename**, and enter a more descriptive name—such as **SfCalendar**. +3. After the snippet is added, the Toolbox assigns a default name. Right-click the item, select **Rename**, and enter a descriptive name (for example, "SfCalendar"). ![Update name](images/update-name.png) -4. After adding the component to the Toolbox, simply **drag the component from the Toolbox into your code editor** to seamlessly use it into your Blazor project. +4. Drag the component from the Toolbox into the code editor to insert the snippet into your Blazor project. + +N> Dragging a Toolbox item inserts code into the editor. Ensure required namespaces and services are present in the project (for example, `@using Syncfusion.Blazor` and registering Syncfusion services in Program.cs). ![Drag component to editor](images/drag-component.gif) diff --git a/blazor/common/how-to/configure-blazor-component-in-bunit-testing.md b/blazor/common/how-to/configure-blazor-component-in-bunit-testing.md index 2ff53b1761..f7b68b5e07 100644 --- a/blazor/common/how-to/configure-blazor-component-in-bunit-testing.md +++ b/blazor/common/how-to/configure-blazor-component-in-bunit-testing.md @@ -1,15 +1,15 @@ --- layout: post -title: Configure Syncfusion Blazor Components in bUnit Testing | Syncfusion -description: Checkout and learn here all about configuring syncfusion Blazor Components in bUnit Testing and much more. +title: Configure Syncfusion Blazor components in bUnit tests | Syncfusion +description: Learn how to configure Syncfusion Blazor components in bUnit using xUnit or NUnit, register required services, write unit tests and explore to more details. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to Configure Syncfusion® Blazor Component in bUnit Testing +# How to configure Syncfusion® Blazor components in bUnit testing -This section explains how to configure Syncfusion® Blazor component in bUnit testing. +This section explains how to configure Syncfusion® Blazor components for unit testing with bUnit. ## Configure bUnit with xUnit Test Project @@ -17,37 +17,37 @@ This section explains how to configure Syncfusion® 1. Open Visual Studio 2022 and create a new `xUnit Test Project`. - ![xUnit project creation in VS 2022](images/bunit/xunit-project.png) + ![xUnit project creation dialog in Visual Studio 2022](images/bunit/xunit-project.png) 2. Specify the project name and click the `Next` button. - ![Specify xUnit project name in Blazor](images/bunit/xunit-project-name.png) + ![Specify the xUnit project name](images/bunit/xunit-project-name.png) -3. Select specific `Target Framework` and click the `Create` button. +3. Select the target framework and click the `Create` button. - ![Select target framework for xUnit project in Blazor](images/bunit/xunit-target-framework.png) + ![Select the target framework for the xUnit project](images/bunit/xunit-target-framework.png) -4. Right-click on the project in the Solution Explorer and select `Manage NuGet Package`. +4. Right-click the project in Solution Explorer and select `Manage NuGet Packages`. - ![Manage NuGet package on xUnit project](images/bunit/xunit-manage-nuget-package.png) + ![Open Manage NuGet Packages on the xUnit project](images/bunit/xunit-manage-nuget-package.png) -5. Search `bunit` and install both NuGet packages in the test project. +5. Search for `bunit` and install both NuGet packages in the test project. - ![Installing bunit NuGet package in Blazor](images/bunit/xunit-bunit-install.png) + ![Install the bUnit NuGet packages in the xUnit project](images/bunit/xunit-bunit-install.png) ### Add Existing Blazor App and Configure it on xUnit Project -1. Right-click on the Solution and select `Add -> Existing Project`. Browse and add your existing project from the local machine. +1. Right-click the solution and select `Add -> Existing Project`. Browse and add your existing Blazor project. - ![Add existing Blazor project](images/bunit/xunit-add-existing-project.png) + ![Add an existing Blazor project to the solution](images/bunit/xunit-add-existing-project.png) N> Refer to [Blazor Web App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) documentation, if you don't have any existing application. -2. Now, right-click on the xUnit project and select `Add -> Project Reference` and select the added project reference. +2. Right-click the xUnit project and select `Add -> Project Reference`, then select the added project. - ![Add existing project reference on xUnit project](images/bunit/xunit-add-project-reference.png) + ![Add a project reference to the xUnit project](images/bunit/xunit-add-project-reference.png) -3. Add the below Syncfusion® Button sample in `~/Pages/Home.razor or Index.razor` file on the Blazor project for testing purpose. You can test your Blazor component from your application instead of the below example component. +3. Add the following Syncfusion® Button sample to the `~/Pages/Home.razor` or `~/Pages/Index.razor` file in the Blazor project for testing purposes. You can test any Blazor component from your app instead of this example. ```cshtml @using Syncfusion.Blazor.Buttons @@ -159,47 +159,47 @@ This section explains how to configure Syncfusion® span.MarkupMatches("Count: 1"); ``` -5. Right-click on the xUnit project and select `Run Tests`. The test cases will run and report the output. +5. Right-click the xUnit project and select `Run Tests`. The test cases run and report the results. - ![xUnit test case result in Blazor](images/bunit/xunit-test-run.png) + ![xUnit test case results](images/bunit/xunit-test-run.png) ## Configure bUnit with NUnit Test Project ### Create NUnit Test Project -1. Open Visual Studio 2022 and create a new `NUnit 3 Text Project`. +1. Open Visual Studio 2022 and create a new `NUnit 3 Test Project`. - ![NUnit project creation in VS 2022](images/bunit/nunit-project.png) + ![NUnit project creation dialog in Visual Studio 2022](images/bunit/nunit-project.png) 2. Specify the project name and click the `Next` button. - ![Specify NUnit project name in Blazor](images/bunit/nunit-project-name.png) + ![Specify the NUnit project name](images/bunit/nunit-project-name.png) -3. Select specific `Target Framework` and click the `Create` button. +3. Select the target framework and click the `Create` button. - ![Select target framework for NUnit project in Blazor](images/bunit/nunit-target-framework.png) + ![Select the target framework for the NUnit project](images/bunit/nunit-target-framework.png) -4. Right-click on the project in the Solution Explorer and select `Manage NuGet Package`. +4. Right-click the project in Solution Explorer and select `Manage NuGet Packages`. - ![Manage NuGet package on NUnit project](images/bunit/nunit-manage-nuget-package.png) + ![Open Manage NuGet Packages on the NUnit project](images/bunit/nunit-manage-nuget-package.png) -5. Search `bunit` and install both NuGet packages in the test project. +5. Search for `bunit` and install both NuGet packages in the test project. - ![Installing bunit NuGet package](images/bunit/nunit-bunit-install.png) + ![Install the bUnit NuGet packages in the NUnit project](images/bunit/nunit-bunit-install.png) ### Add existing Blazor App and configure it on NUnit project -1. Right-click on the Solution and select `Add -> Existing Project`. Browse and add your existing project from the local machine. +1. Right-click the solution and select `Add -> Existing Project`. Browse and add your existing Blazor project. - ![Add existing Blazor project](images/bunit/nunit-add-existing-project.png) + ![Add an existing Blazor project to the solution](images/bunit/nunit-add-existing-project.png) N> Refer to [Blazor Web App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) documentation, if you don't have any existing application. -2. Now, right-click on the NUnit project and select `Add -> Project Reference` and select the added project reference. +2. Right-click the NUnit project and select `Add -> Project Reference`, then select the added project. - ![Add existing project reference on NUnit project](images/bunit/nunit-add-project-reference.png) + ![Add a project reference to the NUnit project](images/bunit/nunit-add-project-reference.png) -3. Add the below Syncfusion® Button sample in `~/Pages/Home.razor or Index.razor` file on the Blazor project for testing purpose. You can test your Blazor component from your application instead of the below example component. +3. Add the following Syncfusion® Button sample to the `~/Pages/Home.razor` or `~/Pages/Index.razor` file in the Blazor project for testing purposes. You can test any component from your app instead of this example. ```cshtml @using Syncfusion.Blazor.Buttons @@ -313,13 +313,13 @@ This section explains how to configure Syncfusion® span.MarkupMatches("Count: 1"); ``` -5. Right-click on the NUnit project and select `Run Tests`. The test cases will run and report the output. +5. Right-click the NUnit project and select `Run Tests`. The test cases run and report the results. - ![NUnit test case result in Blazor](images/bunit/nunit-test-run.png) + ![NUnit test case results](images/bunit/nunit-test-run.png) -## Passing Parameters to the Blazor Component Testing +## Passing parameters to the Blazor component during testing -You can set the Blazor component parameter using `SetParametersAndRender` method. +Set component parameters using the `SetParametersAndRender` method. ```c# using Microsoft.AspNetCore.Components; @@ -357,5 +357,5 @@ public void TestParameter() ## See Also -* [Create a new bUnit Test Project](https://bunit.dev/docs/getting-started/create-test-project.html?tabs=xunit) -* [Test components in ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/test?view=aspnetcore-8.0) +* [Create a new bUnit test project](https://bunit.dev/docs/getting-started/create-test-project.html?tabs=xunit) +* [Test components in ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/test) diff --git a/blazor/common/how-to/create-blazor-webassembly-prerendering.md b/blazor/common/how-to/create-blazor-webassembly-prerendering.md index e70da58060..b7b417494d 100644 --- a/blazor/common/how-to/create-blazor-webassembly-prerendering.md +++ b/blazor/common/how-to/create-blazor-webassembly-prerendering.md @@ -1,19 +1,19 @@ --- layout: post -title: Create a Blazor WebAssembly Application with Prerendering | Syncfusion -description: Checkout and learn here all about creating a Blazor WebAssembly Application with Prerendering and much more. -platform: Blazor -component: Common +title: Create a Blazor WebAssembly App with prerendering | Syncfusion +description: Learn how to enable prerendering for a hosted Blazor WebAssembly app, resolve HttpClient issues, and configure routing. +platform: blazor +control: Common documentation: ug --- # How to Create a Blazor WebAssembly Application with Prerendering -This section explains how to enable prerendering to a Blazor WebAssembly application. +This section explains how to enable prerendering for a hosted Blazor WebAssembly application. ## Prerequisites -[.NET 7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) or later. +Install the [.NET SDK](https://dotnet.microsoft.com/en-us/download) (7.0 or later). ## Create a new project for Blazor WebAssembly ASP.NET Core Hosted application @@ -21,7 +21,7 @@ This section explains how to enable prerendering to a Blazor WebAssembly applica 2. Delete `~/wwwroot/index.html` file in the Client project. -3. Remove the below line from Client project's `~/Program.cs` file. +3. Remove the following line from the Client project's `~/Program.cs` file. ```c# // builder.RootComponents.Add("#app"); @@ -29,7 +29,7 @@ This section explains how to enable prerendering to a Blazor WebAssembly applica 4. Add `~/Pages/_Host.cshtml` file in the Server project. - ![Add Host.cshtml file in Server app](images/wasm-prerender-host-file.png) +![Add the _Host.cshtml file to the Server App](images/wasm-prerender-host-file.png) 5. Copy and paste the below code content in the `~/Server/Pages/_Host.cshtml` file. @@ -66,7 +66,7 @@ This section explains how to enable prerendering to a Blazor WebAssembly applica ``` -6. Open `Program.cs` file in the Server project and change endpoint of `MapFallbackToFile` configuration from `index.html` to `/_Host`. +6. Open the `Program.cs` file in the Server project and change the endpoint of the `MapFallbackToFile` configuration from `index.html` to `/_Host`. ```c# .... @@ -78,7 +78,7 @@ This section explains how to enable prerendering to a Blazor WebAssembly applica }); ``` -7. Add Syncfusion® Blazor service in the `~/Server/Program.cs` file. +7. Add the Syncfusion® Blazor service in the `~/Server/Program.cs` file. ```c# using Syncfusion.Blazor; @@ -87,17 +87,17 @@ This section explains how to enable prerendering to a Blazor WebAssembly applica ``` -8. If you don't inject and use `HttpClient` DI on your index page, you can run the application and the component will render in the web browser with prerendering mode. +8. If `HttpClient` is not injected and used on the index page, you can run the application and the component will render in the web browser with prerendering mode. - The created [Blazor WebAssembly ASP.NET Core Hosted application](../introduction#create-a-new-project-for-blazor-webassembly-aspnet-core-hosted-application) has injected the `HttpClient` DI and fetch the data from server for SfGrid component data source. So, refer to the next topic to resolve the `HttpClient` error on prerendering mode. + The created [Blazor WebAssembly ASP.NET Core Hosted application](../introduction#create-a-new-project-for-blazor-webassembly-aspnet-core-hosted-application) injects `HttpClient` to fetch data for the Grid component. Refer to the next section to resolve `HttpClient` errors during prerendering. ### Resolving HttpClient errors on WebAssembly prerendering -When the index page is injected with the `HttpClient` and tried to prerender on the server, the client will not establish its connection at that time. So, it will throw the runtime exceptions. +When the index page injects `HttpClient` and prerender on the server, the client has not yet established a connection, which can result in runtime exceptions. E> ***InvalidOperationException***: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. -The Syncfusion® Blazor service has registered the HttpClient service itself by default. When you run the `WebAssemblyPrerendered` mode application, it tries to get the WebAPI with its absolute URI or BaseAddress. +The Syncfusion® Blazor service registers the HttpClient by default. In `WebAssemblyPrerendered` mode, requests require an absolute URI or a configured BaseAddress. If you configure with absolute URI in the `~/Client/Pages/Index.razor` file, you will face another runtime error. @@ -112,9 +112,9 @@ E> ***SocketException***: An existing connection was forcibly closed by the remo ***IOException***: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
***HttpRequestException***: An error occurred while sending the request. -We are trying to use HTTP from Server to get the fetch data. But, it is also not possible in the prerender mode because of the client is not yet established. +Fetching data over HTTP from the client is not possible during prerendering because the client has not initialized. -Refer to the below steps to resolve these issues and make the app running with HttpClient in the prerendering mode. +Follow these steps to resolve these issues and enable HttpClient usage during prerendering: 1. Create a public interface in the `~/Shared/WeatherForecast.cs` file on the Shared project to abstract the API call. @@ -154,7 +154,7 @@ Refer to the below steps to resolve these issues and make the app running with H } ``` -3. create a new class file with same class name on the Server project and inherit with the interface `IWeatherForecastService`. Here, the existing API `~/Server/Controller/WeatherForecastController.cs` data creation process moved into the override method `GetForecastAsync`. +3. Create a new class file with the same class name in the Server project and implement the `IWeatherForecastService` interface. Move the data creation logic from the existing API to the `GetForecastAsync` method. The existing controller is at `~/Server/Controllers/WeatherForecastController.cs`. ```c# using System; @@ -185,7 +185,7 @@ Refer to the below steps to resolve these issues and make the app running with H } ``` -4. Now, the API controller will have the below changes on `~/Server/Controller/WeatherForecastController.cs` file. +4. Update the API controller in the `~/Server/Controllers/WeatherForecastController.cs` file as follows. ```c# using System.Threading.Tasks; @@ -215,7 +215,7 @@ Refer to the below steps to resolve these issues and make the app running with H } ``` -5. Register the services in both Client and Server project `~/Program.cs`file. +5. Register the services in both the Client and Server project `~/Program.cs` files. ```c# .... @@ -245,9 +245,9 @@ Refer to the below steps to resolve these issues and make the app running with H } ``` -7. Run the application by pressing `F5` key. The Server prerendering will get the data from its local service, and when it renders on the Client, the HTTP Get request will be sent to get the data. +7. Run the application (for example, press `F5`). During server prerendering, data is provided by the server-side service; after client-side hydration, the client sends the HTTP GET request to retrieve data. ## See Also -* [Prerender on ASP.NET Core Razor Component](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-7.0&pivots=webassembly) -* [Stateful Reconnection After Prerendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle?view=aspnetcore-7.0#stateful-reconnection-after-prerendering) \ No newline at end of file +* [Prerender on ASP.NET Core Razor components](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/integration) +* [Stateful reconnection after prerendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle#stateful-reconnection-after-prerendering) diff --git a/blazor/common/how-to/port-blazor-server-maui.md b/blazor/common/how-to/port-blazor-server-maui.md index 9393d003fa..66033d167b 100644 --- a/blazor/common/how-to/port-blazor-server-maui.md +++ b/blazor/common/how-to/port-blazor-server-maui.md @@ -1,48 +1,45 @@ --- layout: post -title: Port Blazor Server Side App to MAUI Blazor Hybrid App | Syncfusion -description: Checkout and learn here all about porting Syncfusion Blazor Server App to .NET MAUI Blazor Hybrid App. +title: Port a Blazor Web App to a .NET MAUI Blazor Hybrid App | Syncfusion +description: Learn here about how to migrate a Blazor Web App to a .NET MAUI Blazor Hybrid app using a Razor Class Library (RCL) to reuse pages, assets, and services. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to port Syncfusion® Blazor Web App to MAUI Blazor Hybrid App +# How to port Syncfusion® Blazor Web App to .NET MAUI Blazor Hybrid App -This section explains how to port Syncfusion® Blazor Web App to .NET MAUI Blazor Hybrid App using Razor Class Library (RCL). This way, you can avoid rewriting all your Blazor Web App pages for the .NET MAUI Blazor Hybrid App. +This guide explains how to migrate a Blazor Web App to a .NET MAUI Blazor Hybrid App by using a Razor Class Library (RCL) to share pages, layouts, assets, and services. This approach avoids rewriting Blazor Web App pages for the .NET MAUI Blazor Hybrid app. ## Prerequisites -[.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later. +Install the [.NET SDK 8.0](https://dotnet.microsoft.com/en-us/download) or later and Visual Studio 2022 with the .NET MAUI and ASP.NET and web development workloads. -## Create a new project for Blazor Server App +## Create a Blazor Web App -Create a new [Blazor Web App](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) with Syncfusion® `Blazor Calendar` component using [Visual Studio](https://visualstudio.microsoft.com/vs/). +Create a new [Blazor Web App](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) that uses the Syncfusion® Blazor Calendar component in [Visual Studio](https://visualstudio.microsoft.com/vs/). -### 1. Create MAUI Hybrid App in Visual Studio +### 1. Create a .NET MAUI Blazor Hybrid App in Visual Studio -Open Visual Studio and create a new project. Search for [.NET MAUI Blazor Hybrid App](https://blazor.syncfusion.com/documentation/getting-started/maui-blazor-app) template. -Name the project and create it. +Open Visual Studio and create a new project using the [.NET MAUI Blazor Hybrid App](https://blazor.syncfusion.com/documentation/getting-started/maui-blazor-app) template. Specify a project name and create the project. -### 2. Create Razor Class Library (RCL) +### 2. Create a Razor Class Library (RCL) -In the solution, add a new project using the [Razor Class Library](https://blazor.syncfusion.com/documentation/getting-started/razor-class-library) template in Visual Studio and ensure it targets .NET 8.0 to match both Blazor Web App and Blazor Maui Hybrid. +In the solution, add a new project using the [Razor Class Library](https://blazor.syncfusion.com/documentation/getting-started/razor-class-library) template in Visual Studio. Ensure it targets .NET 8.0 to match both the Blazor Web App and the .NET MAUI Blazor Hybrid App. -### 3. Migrate Static Assets, References, NuGet Packages, Razor Pages +### 3. Migrate static assets, references, NuGet packages, and Razor pages -Move all static assets (such as CSS, JavaScript, and images) from the Blazor Web App’s wwwroot folder to the Razor Class Library’s wwwroot directory. Then, update the asset references in the MAUI Hybrid App’s wwwroot/index.html to use the Razor Class Library’s assets via the _content/RazorClassLibrary/ path. +- Move all static assets (such as CSS, JavaScript, and images) from the Blazor Web App’s `wwwroot` folder to the Razor Class Library’s `wwwroot` directory. Then, update asset references in the .NET MAUI Blazor Hybrid App to use the RCL assets via the `_content/RazorClassLibrary/` path. +- Move Syncfusion® Blazor NuGet package references from the Blazor Web App `.csproj` to the RCL `.csproj`. +- Move `Components/Pages` and `Components/Layouts` to the Razor Class Library. Add the necessary namespaces in the RCL’s `_Imports.razor` file. -Move all Syncfusion® `Blazor NuGet packages` references from the Blazor web app's .csproj to the RCL's .csproj +![Folders to move into the RCL](images/server-folders.png) -Move Components/Pages ,Components/Layouts to the RazorClassLibrary and Add Include Necessary Namespace to _Imports.razor +### 4. Add project references and register services -![Folders to move](images/server-folders.png) +Add the Razor Class Library as a project reference in both the Blazor Web App and the .NET MAUI Blazor Hybrid App. Resolve any missing references or errors. After verifying the reference, remove folders such as `Components/Pages` and `Components/Layouts` from the .NET MAUI Blazor App to avoid duplication and keep the project structure clean. -### 4. Add Project Reference - -Afterward, add Razor Class Library project reference in both the Blazor Web App and the MAUI Blazor App. Resolve any missing references or errors that arise. Once completed, remove folders such as Components/Pages and Components/Layouts from the MAUI Blazor App to avoid duplication and maintain a clean project structure. - -Now, register the Syncfusion® Blazor service in the `MauiProgram.cs` file of your MAUI Blazor App. +Register the Syncfusion® Blazor service in the `MauiProgram.cs` file of the .NET MAUI Blazor App. {% tabs %} {% highlight C# tabtitle="~/MauiProgram.cs" hl_lines="1 3" %} @@ -55,10 +52,10 @@ Now, register the Syncfusion® Blazor servic {% endhighlight %} {% endtabs %} -Finally, update the _Imports.razor file to include the necessary namespaces from the Razor Class Library. Then, modify the Routes.razor file in the Blazor MAUI Hybrid app to set the DefaultLayout and AppAssembly to use the MainLayout component from the Razor Class Library +Finally, update the `_Imports.razor` file to include the necessary namespaces from the Razor Class Library. Then, modify the `Routes.razor` file in the Blazor MAUI Hybrid app to set the DefaultLayout and AppAssembly to use the `MainLayout` component from the Razor Class Library ### 5. Run the project - In the Visual Studio toolbar, select the **Windows Machine** button to build and run the app. +In the Visual Studio toolbar, select the target (for example, **Windows Machine**) to build and run the app. -![Build and run MAUI Blazor Hybrid App](images/windows-machine-mode.png) \ No newline at end of file +![Build and run the .NET MAUI Blazor Hybrid App](images/windows-machine-mode.png) \ No newline at end of file diff --git a/blazor/common/how-to/render-blazor-server-app-in-ie.md b/blazor/common/how-to/render-blazor-server-app-in-ie.md index 232192b82c..67179f3057 100644 --- a/blazor/common/how-to/render-blazor-server-app-in-ie.md +++ b/blazor/common/how-to/render-blazor-server-app-in-ie.md @@ -1,27 +1,27 @@ --- layout: post -title: Render the Blazor Server App in IE11 Browser in Blazor - Syncfusion -description: Learn here all about how to Render the Blazor Server App in IE11 Browser in Blazor component and more. +title: Render a Blazor Server app in IE11 | Syncfusion +description: Learn how to run a Blazor Server app in Internet Explorer 11 (IE11) using polyfills for legacy .NET Core 3.1 apps, and understand current browser support. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to Render the Blazor Server Application in IE11 Web Browser +# Render a Blazor Server app in Internet Explorer 11 (IE11) -This section explains how to render the Blazor Server application in IE11 web browser. +This topic explains the historical guidance for running a Blazor Server app in Internet Explorer 11 (IE11). -## Blazor Client/WebAssembly App +## Blazor WebAssembly App -The Microsoft Internet Explorer doesn't support with `WebAssembly`. So, Blazor Client/WebAssembly application does not support with Internet Explorer web browser. +Internet Explorer does not support WebAssembly. Blazor WebAssembly apps do not run in IE11. ## Blazor Server App -The Microsoft Internet Explorer supports `Blazor Server` app with additional polyfills in .NET Core 3.1 apps. However, it is not support with .NET 5.0 or later versions. Refer to [Blazor updated browser support](https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-7.0) for more information. +IE11 can run Blazor Server Apps only when using .NET Core 3.1 with additional polyfills. IE11 is not supported for Blazor on .NET 5.0 or later. For current details, see [Blazor supported platforms and browsers](https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms). -Find the following steps to add the polyfills in the Blazor server application. +Follow these steps to add the polyfills for a .NET Core 3.1 Blazor Server app: -1. Create a Blazor server application using [Blazor Server Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) documentation. +1. Create a Blazor Server Application using the [Blazor Server getting started](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) guide. 2. Add the polyfill script reference in the `` element of the `~/Pages/_Host.cshtml` page. @@ -36,13 +36,13 @@ Find the following steps to add the polyfills in the Blazor server application. ``` - N> This [polyfill](https://github.com/Daddoon/Blazor.Polyfill/releases/tag/3.0.8) is required to configure in Blazor server application for IE 11 support for .NET Core 3.1 app. +N> This [polyfill](https://github.com/Daddoon/Blazor.Polyfill/releases/tag/3.0.8) is required to configure in Blazor server application for IE 11 support for .NET Core 3.1 app. -3. Run the application in the IE 11 web browser and the Syncfusion® Blazor Component is now rendered on IE 11. +3. Run the application in IE11. The Syncfusion® Blazor component renders in IE11 when polyfills are correctly configured. ![Syncfusion component rendering on IE11](images/rendering-component-on-ie11.png) ## See Also -* [Blazor Updated Browser Support](https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/5.0/blazor-browser-support-updated) -* [Blazor Browser Support on .NET 7.0](https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-7.0) +* [Blazor supported platforms and browsers](https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms) +* [Blazor Browser Support](https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms) diff --git a/blazor/common/how-to/troubleshoot.md b/blazor/common/how-to/troubleshoot.md index b490a8089d..009a15f0cb 100644 --- a/blazor/common/how-to/troubleshoot.md +++ b/blazor/common/how-to/troubleshoot.md @@ -1,9 +1,9 @@ --- layout: post -title: How to troubleshoot server & client exceptions in Blazor | Syncfusion -description: Checkout and learn here all about troubleshooting server and client exceptions in Blazor and much more. +title: Troubleshoot server and client exceptions in Blazor | Syncfusion +description: Learn here about how to diagnose and resolve common server and client exceptions in Blazor, including runtime, compile-time, and browser console errors. platform: Blazor -component: Common +control: Common documentation: ug --- @@ -25,7 +25,7 @@ documentation: ug **Solution:** - You can register the `SyncfusionBlazorService` in `Program.cs` file to resolve the exception. + Register the `SyncfusionBlazorService` in the `Program.cs` file to resolve the exception. ```c# using Syncfusion.Blazor; @@ -50,7 +50,7 @@ documentation: ug Update your dotnet SDK/hosting bundle with the latest version in your production/hosting server machine. - Install the latest dotnet SDK/hosting bundle from [here](https://dotnet.microsoft.com/en-us/download/dotnet) in your hosting machine to resolve this. + Install the latest .NET SDK/hosting bundle from [here](https://dotnet.microsoft.com/en-us/download/dotnet) on the hosting machine to resolve this. * **The type name 'Shared' does not exist in the type 'SyncfusionBlazor'** @@ -111,7 +111,7 @@ documentation: ug **Solution** - The Syncfusion® Blazor library has changed its namespace, NuGet package name, component name from v18.1.0.36. Refer this [documentation](./upgrade-syncfusion-components-to-18.1.0.36-version#namespace-changes) to migrate your application with correct namespace. Example: `Syncfusion.EJ2.Blazor` is now modified as `Syncfusion.Blazor`. + The Syncfusion® Blazor library changed its namespace, NuGet package name, and component names starting with v18.1.0.36. Refer to this [documentation](../how-to/upgrade-syncfusion-components-to-18dot1-version#namespace-changes) to migrate the application with the correct namespace. Example: `Syncfusion.EJ2.Blazor` is now `Syncfusion.Blazor`. * **Found markup element with unexpected name 'Ejs'. If this is intended to be a component, add a @using directive for its namespace** @@ -125,7 +125,7 @@ documentation: ug **Solution** - The Syncfusion® Blazor library has changed its namespace, NuGet package name and component name from v18.1.0.36. Refer this [documentation](./upgrade-syncfusion-components-to-18.1.0.36-version#component-name-changes) to migrate your application with correct component name. Example: `EjsGrid` is now modified as `SfGrid`. + The Syncfusion® Blazor library changed its namespace, NuGet package name, and component names starting with v18.1.0.36. Refer to this [documentation](./upgrade-syncfusion-components-to-18.1.0.36-version#component-name-changes) to migrate the application with the correct component names. Example: `EjsGrid` is now `SfGrid`. ## Browser console errors @@ -203,9 +203,9 @@ documentation: ug | ------------- | ------------- | | `` | `app.UsePathBase("/myblazorapp");`| - N> The trailing slash is must for '_Host.cshtml' base path configuration. + N> The trailing slash is required for the '_Host.cshtml' base path configuration. - For further details, refer [Host and deploy ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-7.0&tabs=visual-studio#app-base-path) topic. + For further details, refer to [Host and deploy ASP.NET Core Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy#app-base-path). ## See also diff --git a/blazor/common/how-to/upgrade-syncfusion-components-to-18dot1-version.md b/blazor/common/how-to/upgrade-syncfusion-components-to-18dot1-version.md index ec5e7282cf..91c76dd3b3 100644 --- a/blazor/common/how-to/upgrade-syncfusion-components-to-18dot1-version.md +++ b/blazor/common/how-to/upgrade-syncfusion-components-to-18dot1-version.md @@ -1,21 +1,21 @@ --- layout: post title: Configure Syncfusion Blazor Client Resources in Production -description: Check out the documentation for Configure Syncfusion Blazor Client Resources in Production Environment in Blazor +description: Migrate a Blazor application from EJ2-based package to Syncfusion Blazor 18.1.0.36, including NuGet, namespace, component prefix, resource, DataManager changes. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to upgrade Syncfusion® Blazor Components to 18.1.0.36 version +# How to upgrade Syncfusion® Blazor Components to 18.1.0.36 version -To upgrade Syncfusion® Blazor Components to 18.1.0.36 version, you need to check the following: +This guide explains the one-time migration required when upgrading from Syncfusion Blazor packages to version 18.1.0.36 and later. ## NuGet changes -Previous versions of the Syncfusion® Blazor NuGet package name is `Syncfusion.EJ2.Blazor`. From version 18.1.0.36, it will be `Syncfusion.Blazor`. Other Blazor packages will also have the same name changes. +In previous versions, the primary Syncfusion Blazor NuGet package name was `Syncfusion.EJ2.Blazor`. Starting with version 18.1.0.36, the package name is `Syncfusion.Blazor`. Other Blazor packages follow the same naming change. -For example, refer to the following table for changes in the Blazor packages name. +The following table shows example package ID changes: | Before 18.1.0.36 version | From 18.1.0.36 version | | ------------- | ------------- | @@ -27,7 +27,7 @@ For example, refer to the following table for changes in the Blazor packages nam ## Namespace changes -The previous version of Syncfusion® Blazor contains the namespace `Syncfusion.EJ2.Blazor` followed by component package names such as Buttons, Charts, Grids, and Inputs. After 18.1.0.36 version, this has been modified to `Syncfusion.Blazor` followed by its package name. Check the following table for examples. +Earlier versions used the root namespace `Syncfusion.EJ2.Blazor` followed by component package names such as Buttons, Charts, Grids, and Inputs. From version 18.1.0.36, the root namespace is `Syncfusion.Blazor` followed by the package name. The following table provides examples: | Before 18.1.0.36 version | From 18.1.0.36 version | | ------------- | ------------- | @@ -39,7 +39,7 @@ The previous version of Syncfusion® Blazor ## Component name changes -In the previous version, the component names are prefixed with Ejs (example: EjsGrid, EjsChart) which has been changed to the prefix Sf (example: SfGrid, SfChart). Check the following examples for your reference. +In earlier versions, component names were prefixed with Ejs (for example, EjsGrid, EjsChart). Starting with 18.1.0.36, the prefix is Sf (for example, SfGrid, SfChart). See the following examples: @@ -87,7 +87,7 @@ In the previous version, the component names are prefixed with Ejs (example: Ejs ## Resource changes -Till the previous version, you will be loading scripts `ej2.min.js` and `ejs-interop.min.js` manually in the application, which is not required from 18.1.0.36 version. The script will be loaded from NuGet through static web assets for the components loaded on the page. We have also provided styles as static web assets to load in the application. +In earlier versions, the application manually referenced the `ej2.min.js` and `ejs-interop.min.js` scripts. Starting with 18.1.0.36, scripts are loaded automatically via static web assets from the NuGet package for the components used on the page. Styles are also provided as static web assets to reference in the application.
@@ -129,11 +129,11 @@ Till the previous version, you will be loading scripts `ej2.min.js` and `ejs-int
-Still, you can load the resource from CRG by disabling default script loading from static web assets by passing arguments to `AddSyncfusionBlazor` service in the `~/Program.cs` file. +If needed, resources can be loaded from the Custom Resource Generator (CRG) by disabling default script loading from static web assets using options passed to the `AddSyncfusionBlazor` service in the `~/Program.cs` file. ## DataManager changes -In the previous version, Query's initialization was made as `new ej.data.Query()`. From version 18.0.1.36, it has been changed to `new sf.data.Query()`. Check the following table for examples. +In previous versions, Query initialization used `new ej.data.Query()`. From version 18.1.0.36, it uses `new sf.data.Query()`. See the following examples: @@ -191,4 +191,4 @@ In the previous version, Query's initialization was made as `new ej.data.Query()
-N> To downgrade the project from 18.1.0.36 version, you need to do the reverse process of the previous steps. \ No newline at end of file +N> To downgrade a project from version 18.1.0.36, reverse the steps outlined above. diff --git a/blazor/common/how-to/upgrade-syncfusion-components-to-latest-version.md b/blazor/common/how-to/upgrade-syncfusion-components-to-latest-version.md index 2f5a114592..e671006d4b 100644 --- a/blazor/common/how-to/upgrade-syncfusion-components-to-latest-version.md +++ b/blazor/common/how-to/upgrade-syncfusion-components-to-latest-version.md @@ -1,62 +1,63 @@ --- layout: post -title: Upgrade Syncfusion Components to Latest Version in Blazor - Syncfusion -description: Check out the documentation for Upgrade Syncfusion Components to Latest Version in Blazor Application. +title: Upgrade Syncfusion Blazor components to the latest version +description: Learn how to upgrade Syncfusion Blazor components, verify .NET compatibility, ensure correct CSS references and configuration for Blazor Web, Server, WASM App. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to upgrade Syncfusion® Blazor Components to the latest version +# Upgrade Syncfusion® Blazor components to the latest version -To upgrade Syncfusion® Blazor Components to the latest version, you need to ensure the following: +Use the following checklist to upgrade Syncfusion® Blazor components safely and consistently. ## Compatible .NET version -Syncfusion® Blazor components in the latest version `'{:nuget-version:}'` are compatible with the latest version of [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0). Also, refer to [version compatibility](./version-compatibility) documentation for more information about version compatibility of Syncfusion® Blazor components and .NET Core SDK. +Syncfusion® Blazor components in the latest version `'{:nuget-version:}'` are compatible with the latest version of [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0). Also, refer to [version compatibility](./version-compatibility) documentation for more information about version compatibility of Syncfusion® Blazor components and .NET SDK. ## Client resource file references -Ensure your CSS files have been properly configured in your application. +Ensure CSS resources are correctly referenced in the application. -* Add the following style file reference in the **~/Components/App.razor** for Blazor Web app or add it in the **~/Pages/_Host.cshtml** for Blazor Server app or add it in the **~/wwwroot/index.html** for Blazor WebAssembly app. +* Add the following style reference in the appropriate file based on the hosting model: in **~/Components/App.razor** for Blazor Web App, in **~/Pages/_Host.cshtml** for Blazor Server App, or in **~/wwwroot/index.html** for Blazor WebAssembly App. - If you are using `Syncfusion.Blazor` NuGet package in your application, then use the below reference link. + If using the `Syncfusion.Blazor` NuGet package, include the following reference: ```html ``` - If you are using [individual NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) in your application, then use the below reference link. + If using [individual NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages), include the following reference: ```html ``` -N> For production purpose and minimal requirement, Syncfusion® provides an option to generate custom styles of selective components by using the ThemeStudio web application. Refer to this [link](https://ej2.syncfusion.com/themestudio/) for more details on ThemeStudio. +N> Use a single theme file that matches the chosen look and feel (for example, Bootstrap 5, Material, Tailwind, or Fluent). Replace the file name in the reference with the corresponding theme (for example, `bootstrap5.css`, `material.css`, `tailwind.css`, or `fluent.css`) when applicable. For production builds or minimal bundles, generate custom styles for selected components using the Theme Studio web application at the following link: https://ej2.syncfusion.com/themestudio/. ## Breaking changes -Some changes have been modified in our Blazor samples for each release. So, we suggest you to ensure the breaking changes. Refer to this [release notes](https://blazor.syncfusion.com/documentation/release-notes/28.1.33?type=all) for our Blazor components. +Review breaking changes for each release to understand required code or behavior updates. See the [release notes (breaking changes)](https://blazor.syncfusion.com/documentation/release-notes/index/?type=breaking-changes). ## Cache problem -Before restoring the NuGet packages, clean the older versions of Syncfusion® Blazor NuGet packages. +Before restoring NuGet packages, clear older versions of Syncfusion® Blazor NuGet packages to avoid conflicts. The following steps explain how to clean the cache: 1. Delete the Syncfusion® Blazor NuGet packages from the installed location `{System-driver}/Users/{user-name}/.nuget/packages/`. In Windows, the installed location of Syncfusion® Blazor NuGet packages can be found using `%userprofile%/.nuget/packages/`. +2. Update to the latest Syncfusion® Blazor NuGet packages. -2. Update the latest version of Syncfusion® Blazor NuGet packages. +Tip: The NuGet cache can also be cleared using the .NET CLI: run `dotnet nuget locals all --clear` in a terminal. ## Linker.xml configuration -In Blazor WebAssembly application, ensure if you have configured **Linker.xml** file in your Syncfusion® Blazor application. Missing this configuration may prevent the rendering of Syncfusion® Blazor components in the application. +For Blazor WebAssembly applications, ensure that a Linker.xml (trimming configuration) file is configured when required. Missing this configuration can prevent Syncfusion® Blazor components from rendering. -Refer to this [KB article](https://support.syncfusion.com/kb/article/12054/syncfusion-components-doesnt-render-in-blazor-webassembly-application) for more information on Linker.xml file usage. +Refer to this [KB article](https://support.syncfusion.com/kb/article/12054/syncfusion-components-doesnt-render-in-blazor-webassembly-application) for details on Linker.xml usage. -N> Linker.xml configuration is applicable only for the Blazor WebAssembly application. +N> Linker.xml configuration applies only to Blazor WebAssembly applications. ## See Also -* [Version Compatibility](./version-compatibility) +* [Version compatibility](../version-compatibility) diff --git a/blazor/common/how-to/use-blazor-report-viewer.md b/blazor/common/how-to/use-blazor-report-viewer.md index 15696279ba..9b29ce7a8a 100644 --- a/blazor/common/how-to/use-blazor-report-viewer.md +++ b/blazor/common/how-to/use-blazor-report-viewer.md @@ -1,16 +1,16 @@ --- layout: post -title: Blazor Client Resources in Production Environment - Syncfusion -description: Check out the documentation for Configure Syncfusion Blazor Client Resources in Production Environment in Blazor +title: Use the Blazor Report Viewer (Bold Reports) | Syncfusion +description: Learn here about how to use the Blazor Report Viewer from Bold Reports in Blazor WebAssembly (WASM) and Blazor Server Apps. Explore here to more details. platform: Blazor -component: Common +control: Common documentation: ug --- -# How to Use Syncfusion® Blazor ReportViewer +# How to use the Blazor Report Viewer (Bold Reports) -This section contains the references of how to use Syncfusion® ReportViewer in Blazor application. +The Blazor Report Viewer is provided through the Bold Reports product. Use the following resources to integrate the Report Viewer into Blazor applications. -* [How to Use Syncfusion® ReportViewer in Blazor WebAssembly Application](https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/how-to/use-javascript-reportviewer-in-blazor-web-assembly-application/) -* [How to Use Syncfusion® ReportViewer in Blazor Server Application](https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/how-to/use-javascript-reportviewer-in-blazor-server-application/) -* [Blazor Reporting Components](https://www.boldreports.com/blog/blazor-reporting-components) \ No newline at end of file +* [How to use the Bold Reports Report Viewer in a Blazor WebAssembly App](https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/how-to/use-javascript-reportviewer-in-blazor-web-assembly-application/) +* [How to use the Bold Reports Report Viewer in a Blazor Server App](https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/how-to/use-javascript-reportviewer-in-blazor-server-application/) +* [Learn about Blazor reporting components in Bold Reports](https://www.boldreports.com/blog/blazor-reporting-components) \ No newline at end of file diff --git a/blazor/common/how-to/version-compatibility.md b/blazor/common/how-to/version-compatibility.md index 6fca8ad81f..26638346bb 100644 --- a/blazor/common/how-to/version-compatibility.md +++ b/blazor/common/how-to/version-compatibility.md @@ -1,41 +1,37 @@ --- layout: post -title: Syncfusion Blazor Components Compatibility with .NET Versions -description: Learn here all about supported .NET and .NET Core versions by Syncfusion Blazor Components and much more. +title: Version compatibility for Syncfusion Blazor components +description: Supported .NET and .NET Core versions for Syncfusion Blazor components, with minimum package versions and compatibility guidance. platform: Blazor -component: Common +control: Common documentation: ug --- -# Version Compatibility of Syncfusion® Blazor Components +# Version compatibility for Syncfusion® Blazor components -The following table represents the supported .NET and .NET Core versions by different Syncfusion® Blazor components releases. +The following table shows the supported .NET and .NET Core versions for Syncfusion® Blazor component releases. | Version | Syncfusion® Blazor Components Version | | ------------- | ------------- | | [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) | 27.2.2 and above | | [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) | 23.1.36 and above | -| [.NET 7.0](https://devblogs.microsoft.com/dotnet/announcing-dotnet-7/) | 20.4.0.38 to 28.2.12 | -| [.NET 6.0](https://devblogs.microsoft.com/dotnet/announcing-asp-net-core-in-net-6/) | 19.3.0.43 to 28.2.12 | -| [.NET 5.0](https://devblogs.microsoft.com/dotnet/announcing-asp-net-core-in-net-5/) | 18.4.0.30 to 20.1.0.61 | -| [.NET Core 3.1.3](https://devblogs.microsoft.com/dotnet/blazor-webassembly-3-2-0-release-candidate-now-available/) | 18.1.0.52 to 20.3.0.61 | -| [.NET Core 3.1.2](https://devblogs.microsoft.com/dotnet/net-core-february-2020/) | 18.1.0.42 to 20.3.0.61 | -| [.NET Core 3.1.1](https://devblogs.microsoft.com/dotnet/net-core-january-2020/) | 17.4.0.46 to 20.3.0.61 | -| [.NET Core 3.1](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-net-core-3-1/) | 17.4.0.39 to 20.3.0.61 | +| [.NET 7.0](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) | 20.4.0.38 to 28.2.12 | +| [.NET 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) | 19.3.0.43 to 28.2.12 | +| [.NET 5.0](https://dotnet.microsoft.com/en-us/download/dotnet/5.0) | 18.4.0.30 to 20.1.0.61 | +| [.NET Core 3.1](https://dotnet.microsoft.com/en-us/download/dotnet/3.1) | 17.4.0.39 to 20.3.0.61 | -## Syncfusion® Version Information +## Syncfusion® versioning -Syncfusion® follows a quarterly release schedule, introducing new volumes every three months. To track these releases and their associated changes, Syncfusion® Blazor components utilize a sequence-based identifier system, employing the format **Major.Minor.Revision**. This system enables developers to easily monitor modifications made in each release. +Syncfusion® follows a quarterly release cadence. Blazor component packages use a semantic-style version format: Major.Minor.Revision. -For example, if the release package version is `23.1.36`, the version number can be interpreted as follows: +Example: for version `31.1.23`: -* **23** represents the `major release` version. This number changes every three months and encompasses significant updates, new features, as well as bug fixes and breaking changes. - -* **1** corresponds to the `minor release` version. This number signifies releases primarily focused on new features and addressing bugs, without introducing breaking changes. - -* **36** denotes the `revision number`, also referred to as the `patch number`. This number increases for weekly patch releases, which predominantly consist of bug fixes and do not introduce new features or breaking changes. +* 31 — major release number; updated quarterly and may include new features and breaking changes. +* 1 — minor release number; adds features and fixes without breaking changes. +* 23 — revision (patch); weekly patches with bug fixes and no breaking changes. ## See also -* [Syncfusion® Product release lifecycle](https://www.syncfusion.com/support/product-lifecycle/estudio) +* [Syncfusion® product release lifecycle](https://www.syncfusion.com/support/product-lifecycle/estudio) * [.NET and .NET Core release lifecycle](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) +* [System requirements](https://blazor.syncfusion.com/documentation/system-requirements) diff --git a/blazor/common/html-attributes.md b/blazor/common/html-attributes.md index 594c6c9bd9..96f6ded482 100644 --- a/blazor/common/html-attributes.md +++ b/blazor/common/html-attributes.md @@ -1,17 +1,17 @@ --- layout: post -title: HTML Attributes in Blazor - Syncfusion -description: Check out the documentation for HTML Attributes and supported Blazor components with equivalent properties +title: HTML attributes and DOM events in Blazor - Syncfusion +description: Learn how to use standard HTML attributes and DOM events with Syncfusion Blazor components on input and root elements, and see equivalent component APIs. platform: Blazor -component: Common +control: Common documentation: ug --- -# Default HTML Attributes and DOM Events +# Default HTML attributes and DOM events The Syncfusion® Blazor UI components provide the most useful [public API](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.html) for component implementation and customization. Apart from this public API, the Syncfusion® Blazor UI components can support the use of default [HTML attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) and [DOM events](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-8.0) in the root element of its component. -## Using HTML attributes and DOM events in the input element +## Use HTML attributes and DOM events on input elements The following is a list of Syncfusion® Blazor UI components that use the standard HTML `input` element. You can apply the [HTML input attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) and DOM events directly to the input element used on these Syncfusion® Blazor components. @@ -30,7 +30,7 @@ The following is a list of Syncfusion® Blaz * [SfTimePicker](https://blazor.syncfusion.com/documentation/timepicker/getting-started) * [SfUpload](https://blazor.syncfusion.com/documentation/file-upload/getting-started) -### Available Syncfusion® properties equivalent to HTML attributes +### Syncfusion® properties equivalent to HTML attributes The following table illustrates the HTML attributes and their equivalent Syncfusion® API. @@ -101,7 +101,7 @@ The following table illustrates the HTML attributes and their equivalent Syncfus -min +min Min
    @@ -180,7 +180,7 @@ The following table illustrates the HTML attributes and their equivalent Syncfus -N> If you specify both HTML attribute and Syncfusion® API in the component, then the Syncfusion® API will get higher priority and will be applied to the DOM element. +N> If both an HTML attribute and a Syncfusion® API are specified, the Syncfusion API takes precedence and is applied to the DOM element. ```cshtml @@ -194,7 +194,7 @@ The textbox will be rendered with the following output. ``` -In some cases, you may need to add HTML attributes to the root/container element of the above input-based components. For this, you can use [HtmlAttributes](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfTextBox.html#Syncfusion_Blazor_Inputs_SfTextBox_HtmlAttributes) Syncfusion® API to add HTML attributes to the root/container element. +In some cases, HTML attributes must be added to the root/container element instead of the input. Use the [HtmlAttributes](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfTextBox.html#Syncfusion_Blazor_Inputs_SfTextBox_HtmlAttributes) API to set attributes on the root/container element. ```cshtml @@ -210,7 +210,7 @@ The textbox will be rendered with the following output. ### Input DOM events -The Syncfusion® Blazor UI component supports binding the native [DOM events](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-8.0) on the input element. +Syncfusion® Blazor components support binding native [DOM events](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) on input elements. ```cshtml
    @@ -237,7 +237,7 @@ The Syncfusion® Blazor UI component support } ``` -## Using HTML attributes and DOM events in the root element +## Use HTML attributes and DOM events on the root element The HTML attributes and DOM events can be applied directly to the component's root element. diff --git a/blazor/common/input-validation.md b/blazor/common/input-validation.md index df80cec15d..3c91e6e5a9 100644 --- a/blazor/common/input-validation.md +++ b/blazor/common/input-validation.md @@ -1,9 +1,9 @@ --- layout: post -title: Input Form Validation in Blazor - Syncfusion -description: Check out the documentation for Input Form Validation using data annotation attributes with supported Blazor component list. +title: Input form validation in Blazor - Syncfusion +description: Learn how to validate Syncfusion Blazor input components using data annotations with EditForm, DataAnnotationsValidator, ValidationMessage, ValidationSummary. platform: Blazor -component: Common +control: Common documentation: ug --- @@ -13,7 +13,7 @@ The Syncfusion® Blazor UI input and editor ## How to validate Syncfusion® Blazor UI components -1. Create a model class and set [DataAnnotation attributes](https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0) to its properties. +1. Create a model class and apply [data annotation attributes](https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0) to its properties. ```cshtml @using System.ComponentModel.DataAnnotations; @@ -35,7 +35,7 @@ The Syncfusion® Blazor UI input and editor } ``` -2. Add the `EditForm` component in the view page and assign the model object to its `Model` property. Also, declare the `DataAnnotationsValidator` and `ValidationSummary` components inside the `EditForm` component. +2. Add the `EditForm` component to the page and assign the model object to its `Model` property. Include the `DataAnnotationsValidator` and `ValidationSummary` components inside `EditForm`. ```cshtml @@ -44,10 +44,10 @@ The Syncfusion® Blazor UI input and editor ``` - N> [DataAnnotationsValidator](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.dataannotationsvalidator?view=aspnetcore-8.0) - Attaches validation support to an `EditContext` using data annotations. -
    [ValidationSummary](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.validationsummary?view=aspnetcore-8.0) - Used to display a summarized list of all validation messages. +N> [DataAnnotationsValidator](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.dataannotationsvalidator?view=aspnetcore-8.0): Attaches validation support to the `EditContext` using data annotations. +
    [ValidationSummary](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.validationsummary?view=aspnetcore-8.0): Displays a summarized list of all validation messages. -3. Add any desired [Syncfusion® components](#blazor-form-validation-supported-components) inside the `EditForm` and provide the values through `@bind-` property. +3. Add any desired [Syncfusion® components](#blazor-form-validation-supported-components) inside the `EditForm` and provide values via the appropriate `@bind-` parameter. ```cshtml @@ -65,9 +65,9 @@ The Syncfusion® Blazor UI input and editor ``` - N> Refer to [this table](#blazor-form-validation-supported-components) for the Syncfusion® Blazor components which supports the form validation and its `@bind` property details. +N> Refer to [this table](#blazor-form-validation-supported-components) for Blazor components that support form validation and their corresponding `@bind` parameter details. -4. The `EditForm` validates the input values based on its edit context and displays the validation message on the `ValidationSummary` component when submitting the form. +4. The `EditForm` validates input values based on its `EditContext` and displays validation messages in the `ValidationSummary` component when the form is submitted. **Validation Failure:** @@ -100,7 +100,7 @@ The Syncfusion® Blazor UI input and editor ![Validation message for individual input component in Blazor](images/validation-message.png) -6. The `EditForm`'s submit events [OnValidSubmit](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform.onvalidsubmit?view=aspnetcore-8.0) and [OnInvalidSubmit](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform.oninvalidsubmit?view=aspnetcore-8.0) can be used to get the validation success and failure `EditContext` details. +6. The `EditForm` submit events [OnValidSubmit](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform.onvalidsubmit?view=aspnetcore-8.0) and [OnInvalidSubmit](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform.oninvalidsubmit?view=aspnetcore-8.0) provide the `EditContext` on validation success or failure. ```cshtml @@ -145,11 +145,11 @@ The Syncfusion® Blazor UI input and editor } ``` - W> You shouldn't use the `OnSubmit` handler along with `OnValidSubmit` and `OnInvalidSubmit` event handlers in the `EditForm` component. It will throw a runtime error. +W> Do not use the `OnSubmit` handler together with `OnValidSubmit` and `OnInvalidSubmit` in the same `EditForm`. This causes a runtime error. ## Blazor form validation supported components -The following section provides the details about the Syncfusion® Blazor UI components that are supported with form validation, corresponding `@bind` properties, and validation examples. +The following section lists the Syncfusion® Blazor UI components that support form validation, the corresponding `@bind` parameters, and validation examples. @@ -283,11 +283,11 @@ The following section provides the details about the Syncfusion Razor Component`. Specify the component name and create it. -2. Add Syncfusion® Blazor component in the new component and assign the `Value`, `ValueChanged`, and `ValueExpression` properties. Refer [here](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-8.0#binding-with-component-parameters), to know more about data binding in component parameters. +2. Add a Syncfusion® Blazor component in the new component and assign the `Value`, `ValueChanged`, and `ValueExpression` parameters. Refer to the [data binding with component parameters](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-8.0#binding-with-component-parameters) documentation for details. ```cshtml @using System.Linq.Expressions; diff --git a/blazor/common/localization.md b/blazor/common/localization.md index 167f0661aa..e0af46a0ab 100644 --- a/blazor/common/localization.md +++ b/blazor/common/localization.md @@ -1,43 +1,43 @@ --- layout: post title: Localization (Multi-Language) in Blazor components | Syncfusion -description: Localization of Syncfusion Blazor UI components in Blazor Server and WebAssembly (WASM) apps and much more. +description: Learn how to localize Syncfusion Blazor UI components in Blazor Web App, WASM, Server, and .NET MAUI apps using resource files and dynamic culture switching. platform: Blazor -component: Common +control: Common documentation: ug --- # Localization of Blazor Components -[Localization](https://learn.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-8.0) is the process of translating the application resources into different languages for specific cultures. You can localize the Syncfusion® Blazor components by adding a resource file for each language. +[Localization](https://learn.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-8.0) is the process of translating application resources into different languages for specific cultures. Syncfusion® Blazor components can be localized by adding a resource file for each language. ## Localization of Syncfusion® Blazor Components -The following two steps can be used to localize Syncfusion® Blazor components based on culture. You can find the example codes in the below repository, +Use the following steps to localize Syncfusion® Blazor components based on culture. Example code is available in the repository below. -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/blazor-localization) +N> [View sample on GitHub](https://github.com/SyncfusionExamples/blazor-localization) -### Adding culture based resx files +### Adding culture-based .resx files -Syncfusion® components can be localized using the Resource `.resx` files. You can find the default and culture based localization files in the following GitHub repository. +Syncfusion® components can be localized using Resource `.resx` files. Default and culture-specific localization files are available in the following GitHub repository. -N> You can get default and culture based resource files from [GitHub](https://github.com/syncfusion/blazor-locale). +N> Download default and culture-based resource files from [GitHub](https://github.com/syncfusion/blazor-locale). -Copy the default resx file (`SfResources.resx`) and the other required resx files based on the culture to be localized and add them to the **Resources** folder. If you are implementing in a .NET MAUI Blazor app, create a **LocalizationResources** folder and add them into it. +Copy the default `.resx` file (`SfResources.resx`) and any required culture-specific `.resx` files to the **Resources** folder. For a .NET MAUI Blazor app, create a **LocalizationResources** folder and add them there. ![Adding Resource Files in Blazor](images/localization-resource.png) -N> Update the localization files whenever you upgrade the Syncfusion® NuGet packages in the application to avoid the issues occur due to localization strings. +N> Update the localization files whenever upgrading Syncfusion® NuGet packages to prevent mismatches in localization strings. -After adding the resource file in the application, double click default resx (`SfResources.resx`) file and open **Resource Editor**. In the Resource Editor, change **Access Modifier** option as **Public** . +After adding the resource files, open the default resource file (`SfResources.resx`) in the **Resource Editor** and set **Access Modifier** to **Public**. ![Changing Access Modifier](images/localization-resource-file.png) ### Create and register localization service -[ISyncfusionStringLocalizer](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html) which acts as a middleware to connect the Syncfusion® Blazor UI components and resource files, uses [ResourceManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_ResourceManager) to provide culture specific resources at runtime. Create a class implementing `ISyncfusionStringLocalizer`. In the newly created class, return the `ResourceManager` created in the above step for [ResourceManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_ResourceManager) property and change [GetText](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_GetText_System_String_) method to return localized string using resource manager. +[ISyncfusionStringLocalizer](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html) acts as middleware between Syncfusion® Blazor UI components and resource files and uses the [ResourceManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_ResourceManager) to provide culture-specific resources at runtime. Create a class that implements `ISyncfusionStringLocalizer`. In the class, return the `ResourceManager` created in the previous step for the [ResourceManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_ResourceManager) property and update [GetText](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ISyncfusionStringLocalizer.html#Syncfusion_Blazor_ISyncfusionStringLocalizer_GetText_System_String_) to return the localized string. -In the following code, `SyncfusionLocalizer` class implements `ISyncfusionStringLocalizer` interface and `ResourceManager` configured to return the cached ResourceManager instance of default resource file created in **Adding culture based resx files** step. +In the following code, the `SyncfusionLocalizer` class implements the `ISyncfusionStringLocalizer` interface, and the `ResourceManager` is configured to return the cached `ResourceManager` instance of the default resource file created in the “Adding culture-based .resx files” step. {% tabs %} @@ -70,11 +70,10 @@ public class SyncfusionLocalizer : ISyncfusionStringLocalizer {% endtabs %} -Register the `ISyncfusionStringLocalizer` and `Syncfusion® Blazor Service` in the **~/Program.cs** file of your app. +Register `ISyncfusionStringLocalizer` and the Syncfusion® Blazor service in the **~/Program.cs** file of your app. -* If you create a Blazor Web App with an **Interactive render mode** such as `WebAssembly or Auto`, you need to ensure the registration of the `SyncfusionLocalizer` and Syncfusion® Blazor services in both **~/Program.cs** files. - -* For **MAUI Blazor App**, register the Syncfusion® Blazor Service in the **~/MauiProgram.cs** file. +* For a Blazor Web App using an **Interactive render mode** (WebAssembly or Auto), register `SyncfusionLocalizer` and the Syncfusion® Blazor services in both **Server** and **Client** `~/Program.cs` files. +* For a **.NET MAUI Blazor** app, register the Syncfusion® Blazor service in **~/MauiProgram.cs**. {% tabs %} @@ -93,19 +92,18 @@ builder.Services.AddSingleton(typeof(ISyncfusionStringLocalizer), typeof(Syncfus ## Statically set the culture -If you don't want to change culture dynamically, you can set it statically by following the procedures below. +If culture changes are not required at runtime, set the culture statically using the options below. ### Blazor Web App and Blazor WASM App -In Blazor Web App and Blazor WASM app, you can set culture statically in Blazor's start option or in C# code. - -#### Setting the culture Blazor's start option +In Blazor Web App and Blazor WebAssembly (WASM) apps, set culture either in Blazor’s start options or in C# code. -The app's culture can be set in JavaScript by setting `applicationCulture` in Blazor's start option by following the steps below, +#### Setting the culture in Blazor’s start option -* For **.NET 8 and .NET 9** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), prevent Blazor autostart by adding `autostart="false"` attribute to the Blazor `