diff --git a/blazor-toc.html b/blazor-toc.html index 9ebca5dff7..04a193af95 100644 --- a/blazor-toc.html +++ b/blazor-toc.html @@ -391,6 +391,9 @@
  • Deploy a Blazor Web App to Azure App Service
  • +
  • + Deploy a Blazor Web App to Linux with NGINX +
  • @@ -2186,6 +2189,7 @@
  • Paging
  • Selection
  • Sorting
  • +
  • Toolbar
  • How To @@ -2996,10 +3000,13 @@
  • Asynchronous Upload
  • +
  • FileUpload Configuration
  • +
  • FileUpload Methods
  • Accessibility
  • Chunk Upload
  • Localization
  • File Source
  • +
  • Drag and Drop
  • Template
  • Validation
  • Form Integration
  • @@ -3274,6 +3281,7 @@
  • Reset an image
  • Clear an Image
  • Render Dialog in Image Editor
  • +
  • Fit Image to Editor Width and Height
  • @@ -4095,48 +4103,70 @@
  • Blazor Hybrid MAUI App
  • +
  • Toolbar + +
  • Value Binding
  • -
  • Toolbar
  • -
  • IFrame Editor
  • -
  • Inline Editor
  • Tools +
  • +
  • Editor Types + +
  • +
  • Insert Image and Media +
  • -
  • Enter Key Configuration
  • -
  • Paste Clean-up
  • Smart Editing
  • -
  • Form Validation
  • -
  • Xhtml Validation
  • -
  • Execute Command
  • +
  • Validation and Security + +
  • +
  • Link manipulation
  • +
  • Table manipulation
  • +
  • Code Block
  • +
  • Paste Clean-up
  • +
  • Enter Key Configuration
  • Undo Redo Manager
  • -
  • Resizable Editor
  • +
  • Import/Export
  • +
  • Execute Command
  • Style and Appearance
  • +
  • Style Encapsulation
  • Globalization
  • +
  • Keyboard shortcuts
  • Accessibility
  • WebAssembly Performance
  • -
  • Import and Export
  • -
  • Editor Modes
  • -
  • Keyboard shortcuts
  • Miscellaneous
  • -
  • Import/Export
  • Events
  • How To
  • +
  • 31.2.12 Service Pack Release
  • 31.2.2 Service Pack Release
  • 31.1.17 Main Release
  • 2025 Volume 2 - 30.*
  • 2025 Volume 1 - 29.*
  • 2024 Volume 4 - 28.*
  • 2024 Volume 3 - 27.*
  • 2024 Volume 2 - 26.*
  • 2024 Volume 1 - 25.*
  • 2023 Volume 4 - 24.*
  • 2023 Volume 3 - 23.*
  • 2023 Volume 2 - 22.*
  • 2023 Volume 1 - 21.*
  • diff --git a/blazor/Release-Notes/31.2.12.md b/blazor/Release-Notes/31.2.12.md new file mode 100644 index 0000000000..4b4670d3c6 --- /dev/null +++ b/blazor/Release-Notes/31.2.12.md @@ -0,0 +1,94 @@ +--- +title: Essential Studio for Blazor Release Notes +description: Learn here about the controls in the Essential Studio for Blazor 2025 Volume 3 SP Release - Release Notes +platform: blazor +documentation: ug +--- + +# Essential Studio for Blazor - v31.2.12 Release Notes + +{% include release-info.html date="November 18, 2025" version="v31.2.12" passed="74487" failed="0" %} + +{% directory path: _includes/release-notes/v31.2.12 %} + +{% include {{file.url}} %} + +{% enddirectory %} + +## Test Results + +| Component Name | Test Cases | Passed | Failed | Remarks | +|---------------|------------|--------|--------|---------| +| 3DChart | 198 | 198 | 0 | All Passed | +| Accordion | 232 | 232 | 0 | All Passed | +| AiAssistView | 297 | 297 | 0 | All Passed | +| Appbar | 102 | 102 | 0 | All Passed | +| Autocomplete | 444 | 444 | 0 | All Passed | +| BarcodeGenerator | 440 | 440 | 0 | All Passed | +| Breadcrumb | 137 | 137 | 0 | All Passed | +| Bulletchart | 237 | 237 | 0 | All Passed | +| Button | 255 | 255 | 0 | All Passed | +| Calendar | 146 | 146 | 0 | All Passed | +| Carousel | 174 | 174 | 0 | All Passed | +| Charts | 4175 | 4175 | 0 | All Passed | +| ChatUI | 102 | 102 | 0 | All Passed | +| Chips | 196 | 196 | 0 | All Passed | +| CircularGauge | 928 | 928 | 0 | All Passed | +| ColorPicker | 113 | 113 | 0 | All Passed | +| ComboBox | 248 | 248 | 0 | All Passed | +| DashboardLayout | 253 | 253 | 0 | All Passed | +| DataForm | 547 | 547 | 0 | All Passed | +| DataGrid | 5951 | 5951 | 0 | All Passed | +| DatePicker | 576 | 576 | 0 | All Passed | +| DateRangePicker | 366 | 366 | 0 | All Passed | +| DateTimePicker | 474 | 474 | 0 | All Passed | +| Diagram | 15316 | 15316 | 0 | All Passed | +| Dialog | 481 | 481 | 0 | All Passed | +| DropdownList | 584 | 584 | 0 | All Passed | +| Dropdowntree | 164 | 164 | 0 | All Passed | +| FileManager | 3108 | 3108 | 0 | All Passed | +| FileUpload | 330 | 330 | 0 | All Passed | +| FloatingActionButton | 128 | 128 | 0 | All Passed | +| Gantt | 4800 | 4800 | 0 | All Passed | +| HeatMap | 339 | 339 | 0 | All Passed | +| ImageEditor | 3561 | 3561 | 0 | All Passed | +| InPlaceEditor | 764 | 764 | 0 | All Passed | +| InputMask | 168 | 168 | 0 | All Passed | +| Kanban | 380 | 380 | 0 | All Passed | +| LinearGauge | 799 | 799 | 0 | All Passed | +| ListBox | 138 | 138 | 0 | All Passed | +| ListView | 441 | 441 | 0 | All Passed | +| Maps | 1570 | 1570 | 0 | All Passed | +| Mention | 152 | 152 | 0 | All Passed | +| Menu | 398 | 398 | 0 | All Passed | +| Message | 211 | 211 | 0 | All Passed | +| MultiselectDropdown | 386 | 386 | 0 | All Passed | +| NumericTextbox | 442 | 442 | 0 | All Passed | +| OtpInput | 123 | 123 | 0 | All Passed | +| PivotTable | 1378 | 1378 | 0 | All Passed | +| ProgressBar | 199 | 199 | 0 | All Passed | +| progressbutton | 101 | 101 | 0 | All Passed | +| QueryBuilder | 584 | 584 | 0 | All Passed | +| RangeNavigator | 196 | 196 | 0 | All Passed | +| Rating | 106 | 106 | 0 | All Passed | +| Ribbon | 451 | 451 | 0 | All Passed | +| RichTextEditor | 2768 | 2768 | 0 | All Passed | +| Scheduler | 5623 | 5623 | 0 | All Passed | +| Sidebar | 144 | 144 | 0 | All Passed | +| Slider | 271 | 271 | 0 | All Passed | +| SmithChart | 259 | 259 | 0 | All Passed | +| SparklineChart | 150 | 150 | 0 | All Passed | +| SpeedDial | 353 | 353 | 0 | All Passed | +| Splitter | 190 | 190 | 0 | All Passed | +| Stepper | 218 | 218 | 0 | All Passed | +| StockChart | 335 | 335 | 0 | All Passed | +| Tabs | 936 | 936 | 0 | All Passed | +| TextArea | 126 | 126 | 0 | All Passed | +| Textbox | 653 | 653 | 0 | All Passed | +| Timeline | 182 | 182 | 0 | All Passed | +| TimePicker | 419 | 419 | 0 | All Passed | +| Toast | 233 | 233 | 0 | All Passed | +| Toolbar | 230 | 230 | 0 | All Passed | +| TreeGrid | 4943 | 4943 | 0 | All Passed | +| TreeMap | 704 | 704 | 0 | All Passed | +| TreeView | 1361 | 1361 | 0 | All Passed | diff --git a/blazor/appearance/themes.md b/blazor/appearance/themes.md index 8eb2517954..ee4e79ab8a 100644 --- a/blazor/appearance/themes.md +++ b/blazor/appearance/themes.md @@ -1049,7 +1049,7 @@ The following example demonstrates how to change a theme dynamically in Blazor a * For **Blazor Web App using any interactive render mode (Server, WebAssembly, or Auto)**, the theme is changed based on query string at the **~/Components/App.razor** file {% tabs %} -{% highlight c# tabtitle=".NET 9 & .NET 8 (~/App.razor)" %} +{% highlight c# tabtitle=".NET 10, .NET 9 & .NET 8 (~/App.razor)" %} @using Microsoft.AspNetCore.WebUtilities; @inject NavigationManager UrlHelper; @@ -1166,7 +1166,7 @@ The following example demonstrates how to change a theme dynamically in Blazor a 1. For **Blazor Server application**, the theme is changed based on query string at the **~/Components/App.razor** file. {% tabs %} -{% highlight c# tabtitle=".NET 9 & .NET 8 (~/App.razor)" %} +{% highlight c# tabtitle=".NET 10, .NET 9 & .NET 8 (~/App.razor)" %} @page "/" @namespace BlazorThemeSwitcher.Pages diff --git a/blazor/color-picker/how-to/customize-color-picker.md b/blazor/color-picker/how-to/customize-color-picker.md index 9388d4c41e..35c50d2413 100644 --- a/blazor/color-picker/how-to/customize-color-picker.md +++ b/blazor/color-picker/how-to/customize-color-picker.md @@ -76,9 +76,7 @@ By default, the Palette will be rendered with default colors. To load custom col ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDrKsLhcASTCtgHM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ColorPicker with Custom Palette](./../images/blazor-colorpicker-with-custom-palette.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDrKsLhcASTCtgHM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ColorPicker with Custom Palette](./../images/blazor-colorpicker-with-custom-palette.png)" %} ## Hide input area from picker @@ -92,9 +90,7 @@ In the following sample, the Color Picker is rendered without input area.

    Choose a color

    ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXhKMLLwqoJqULKi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Hide Input Area in Blazor ColorPicker](./../images/blazor-colorpicker-hide-input.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXhKMLLwqoJqULKi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Hide Input Area in Blazor ColorPicker](./../images/blazor-colorpicker-hide-input.png)" %} ## Custom handle @@ -126,6 +122,4 @@ The following sample shows the customized Color Picker handle. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjhKWrLGKyTIhQGO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Customizing Blazor ColorPicker Handle Shape](./../images/blazor-colorpicker-handle-customization.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjhKWrLGKyTIhQGO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Blazor ColorPicker Handle Shape](./../images/blazor-colorpicker-handle-customization.png)" %} \ No newline at end of file diff --git a/blazor/color-picker/how-to/disable-color-picker.md b/blazor/color-picker/how-to/disable-color-picker.md index c582a73b22..bef5800132 100644 --- a/blazor/color-picker/how-to/disable-color-picker.md +++ b/blazor/color-picker/how-to/disable-color-picker.md @@ -19,6 +19,4 @@ The following example shows the `Disabled` state of Color Picker component.

    Choose a color

    ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/htLKsLrGgeJFrvZn?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Disable State in Blazor ColorPicker](./../images/blazor-colorpicker-disable-state.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/htLKsLrGgeJFrvZn?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Disable State in Blazor ColorPicker](./../images/blazor-colorpicker-disable-state.png)" %} \ No newline at end of file diff --git a/blazor/color-picker/how-to/hide-control-buttons.md b/blazor/color-picker/how-to/hide-control-buttons.md index 6551caf8aa..6ae424d0dd 100644 --- a/blazor/color-picker/how-to/hide-control-buttons.md +++ b/blazor/color-picker/how-to/hide-control-buttons.md @@ -17,6 +17,4 @@ Color Picker can be rendered without control buttons (Apply/Cancel). In this cas

    Choose a color

    ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDhAWLBcqoIBqnae?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Hide Control Buttons in Blazor ColorPicker](./../images/blazor-colorpicker-hide-control.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDhAWLBcqoIBqnae?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Hide Control Buttons in Blazor ColorPicker](./../images/blazor-colorpicker-hide-control.png)" %} \ No newline at end of file diff --git a/blazor/color-picker/how-to/no-color-support.md b/blazor/color-picker/how-to/no-color-support.md index 045bfe7b00..eaab09d506 100644 --- a/blazor/color-picker/how-to/no-color-support.md +++ b/blazor/color-picker/how-to/no-color-support.md @@ -40,9 +40,7 @@ To achieve this, set [NoColor](https://help.syncfusion.com/cr/blazor/Syncfusion. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VDVUsLLGKoIFoxSv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ColorPicker with Default No Color](./../images/blazor-colorpicker-nocolor.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VDVUsLLGKoIFoxSv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ColorPicker with Default No Color](./../images/blazor-colorpicker-nocolor.png)" %} >If the [NoColor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfColorPicker.html#Syncfusion_Blazor_Inputs_SfColorPicker_NoColor) property is enabled, make sure to disable the [ModeSwitcher](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfColorPicker.html#Syncfusion_Blazor_Inputs_SfColorPicker_ModeSwitcher) property. @@ -130,6 +128,4 @@ The following sample shows the color palette with custom no color option. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VthAsLLwAyxsVKHl?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ColorPicker with Custom No Color](./../images/blazor-colorpicker-custom-nocolor.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VthAsLLwAyxsVKHl?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ColorPicker with Custom No Color](./../images/blazor-colorpicker-custom-nocolor.png)" %} diff --git a/blazor/color-picker/how-to/render-palette-alone.md b/blazor/color-picker/how-to/render-palette-alone.md index cdf7b06096..aaff123198 100644 --- a/blazor/color-picker/how-to/render-palette-alone.md +++ b/blazor/color-picker/how-to/render-palette-alone.md @@ -19,8 +19,6 @@ In the following sample, the [ShowButtons](https://help.syncfusion.com/cr/blazor

    Choose a color

    ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLKiLLGUoxTFJzx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Rendering Palette Alone in Blazor ColorPicker](./../images/blazor-colorpicker-with-palette-alone.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLKiLLGUoxTFJzx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Rendering Palette Alone in Blazor ColorPicker](./../images/blazor-colorpicker-with-palette-alone.png)" %} N> To render `Picker` alone, specify the [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfColorPicker.html#Syncfusion_Blazor_Inputs_SfColorPicker_Mode) property as 'Picker'. diff --git a/blazor/color-picker/how-to/show-recent-color.md b/blazor/color-picker/how-to/show-recent-color.md index 37e53eff28..595e3c2b5b 100644 --- a/blazor/color-picker/how-to/show-recent-color.md +++ b/blazor/color-picker/how-to/show-recent-color.md @@ -21,6 +21,4 @@ In the following sample, the [`ShowRecentColors`](https://help.syncfusion.com/cr

    Choose a color

    ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLKiLLGUoxTFJzx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Rendering Show Recent color in Blazor ColorPicker](./../images/blazor-colorpicker-show-recent-color.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLKiLLGUoxTFJzx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Rendering Show Recent color in Blazor ColorPicker](./../images/blazor-colorpicker-show-recent-color.png)" %} \ No newline at end of file diff --git a/blazor/color-picker/inline-rendering.md b/blazor/color-picker/inline-rendering.md index 3b47afdca5..21cd3e68e6 100644 --- a/blazor/color-picker/inline-rendering.md +++ b/blazor/color-picker/inline-rendering.md @@ -20,8 +20,6 @@ The following sample shows the inline type rendering of ColorPicker. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNVKsVrQgIVKJnGz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Inline Rendering in Blazor ColorPicker](./images/blazor-colorpicker-inline-rendering.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNVKsVrQgIVKJnGz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Inline Rendering in Blazor ColorPicker](./images/blazor-colorpicker-inline-rendering.png)" %} N> The `ShowButtons` property is disabled in this sample because the control buttons are not needed for inline type. To know about the control buttons functionality, refer to the [ShowButtons](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfColorPicker.html#Syncfusion_Blazor_Inputs_SfColorPicker_ShowButtons). diff --git a/blazor/color-picker/localization.md b/blazor/color-picker/localization.md index adfc4f3824..ac9f6c95b2 100644 --- a/blazor/color-picker/localization.md +++ b/blazor/color-picker/localization.md @@ -29,9 +29,7 @@ You can modify the default value in `.res` file added to Resource folder. Enter ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZhKsVVwqSUTjofI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Localization in Blazor ColorPicker](./images/blazor-colorpicker-localization.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZhKsVVwqSUTjofI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Localization in Blazor ColorPicker](./images/blazor-colorpicker-localization.png)" %} ## RTL @@ -46,6 +44,4 @@ In the following example, Color Picker component is rendered in RTL mode with `a ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZBUsrLmqSKnHwGP?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Right to Left in Blazor ColorPicker](./images/blazor-colorpicker-right-to-left.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZBUsrLmqSKnHwGP?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Right to Left in Blazor ColorPicker](./images/blazor-colorpicker-right-to-left.png)" %} \ No newline at end of file diff --git a/blazor/color-picker/mode-and-value.md b/blazor/color-picker/mode-and-value.md index 0a3c389f66..df826521e9 100644 --- a/blazor/color-picker/mode-and-value.md +++ b/blazor/color-picker/mode-and-value.md @@ -22,9 +22,7 @@ In the following sample, it will render the `Palette` at initial load. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZhgshBQKIhHYIMT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ColorPicker with Palette](./images/blazor-colorpicker-with-palette.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZhgshBQKIhHYIMT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ColorPicker with Palette](./images/blazor-colorpicker-with-palette.png)" %} ## Color value @@ -39,8 +37,6 @@ In the following sample, the color value is set as `four` digit hex code, the la ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVUCBBQUeLkCZYv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Changing Blazor ColorPicker value](./images/blazor-colorpicker-value.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVUCBBQUeLkCZYv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Changing Blazor ColorPicker value](./images/blazor-colorpicker-value.png)" %} N> The [Value](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfColorPicker.html#Syncfusion_Blazor_Inputs_SfColorPicker_Value) property supports hex code with or without `#` prefix. diff --git a/blazor/combobox/cascading.md b/blazor/combobox/cascading.md index 1ea58cd309..85b939ce9c 100644 --- a/blazor/combobox/cascading.md +++ b/blazor/combobox/cascading.md @@ -25,9 +25,7 @@ In the following example, when a country is selected in the first ComboBox, the {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDLUsVBmKweKQSWe?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Cascading in Blazor ComboBox](./images/cascading/blazor_combobox_cascading.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDLUsVBmKweKQSWe?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Cascading in Blazor ComboBox](./images/cascading/blazor_combobox_cascading.gif)" %} ## Cascading with other form field @@ -41,8 +39,6 @@ In the following example, the ComboBox displays a list of countries, and the tex {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BthKWhhGKcenJwTt?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Cascading with other form field in Blazor ComboBox](./images/cascading/blazor_combobox_cascading-with-other-form-field.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BthKWhhGKcenJwTt?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Cascading with other form field in Blazor ComboBox](./images/cascading/blazor_combobox_cascading-with-other-form-field.png)" %} N> [View Sample in Demo](https://blazor.syncfusion.com/demos/combobox/cascading?theme=bootstrap5). \ No newline at end of file diff --git a/blazor/combobox/custom-value.md b/blazor/combobox/custom-value.md index 8db6912063..5b4aeac34d 100644 --- a/blazor/combobox/custom-value.md +++ b/blazor/combobox/custom-value.md @@ -11,6 +11,4 @@ documentation: ug You can add custom value to the ComboBox component. When the typed character(s) is not present in the list, a button will be shown in the popup list. By clicking on this button, the custom value character(s) get added to the existing list as a new item. Default value of [AllowCustom](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DropDowns.SfComboBox-2.html#Syncfusion_Blazor_DropDowns_SfComboBox_2_AllowCustom) is `true`. -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDBACVLQKFyiyoKz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with custom value](./images/blazor-combobox-custom-value.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDBACVLQKFyiyoKz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with custom value](./images/blazor-combobox-custom-value.png)" %} \ No newline at end of file diff --git a/blazor/combobox/data-source.md b/blazor/combobox/data-source.md index 33f63ac18c..8f8ae07f93 100644 --- a/blazor/combobox/data-source.md +++ b/blazor/combobox/data-source.md @@ -72,9 +72,7 @@ In the following example, `Name` column from complex data has been mapped to the }; } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXBKsLLcKnxcdvLv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Binding Blazor ComboBox Items](./images/blazor-combobox-binding-items.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXBKsLLcKnxcdvLv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Binding Blazor ComboBox Items](./images/blazor-combobox-binding-items.png)" %} ### Array of complex data @@ -121,9 +119,7 @@ public IEnumerable LocalData { get; set; } = new Complex().GetData(); } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rZrqiLVwKHwhTfxb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Binding Complex Items with Blazor ComboBox](./images/blazor-combobox-complex-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rZrqiLVwKHwhTfxb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Binding Complex Items with Blazor ComboBox](./images/blazor-combobox-complex-data.png)" %} ## Binding remote data @@ -159,9 +155,7 @@ In the following sample, First 6 contacts are displayed from the **Customers** t } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VthUChrmAnbDTsys?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with Data Binding](./images/blazor-combobox-binding-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VthUChrmAnbDTsys?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with Data Binding](./images/blazor-combobox-binding-data.png)" %} ### Web API Adaptor @@ -188,9 +182,7 @@ Use the `WebApiAdaptor` to bind ComboBox with Web API created using OData. } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjBgiVLwKnloDWBQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with Web API Data](./images/blazor-combobox-web-api-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjBgiVLwKnloDWBQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with Web API Data](./images/blazor-combobox-web-api-data.png)" %} ### Custom adaptor @@ -302,9 +294,7 @@ The following example for remote data binding and enabled offline mode, } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtBACrBQKGCrmiJb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox in Offline Mode](./images/blazor-combobox-web-api-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtBACrBQKGCrmiJb?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox in Offline Mode](./images/blazor-combobox-web-api-data.png)" %} ### ValueTuple data binding @@ -320,9 +310,7 @@ You can bind [ValueTuple](https://learn.microsoft.com/en-us/dotnet/api/system.va ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDrKihrcgcMdJUXG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox ValueTuple Data](./images/blazor_combobox_valuetuple.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDrKihrcgcMdJUXG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox ValueTuple Data](./images/blazor_combobox_valuetuple.png)" %} ## Binding ExpandoObject @@ -448,10 +436,7 @@ You can bind [ObservableCollection](https://learn.microsoft.com/en-us/dotnet/api } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBgCBVcAmhLLFOi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - - -![Blazor ComboBox with observable collection data binding](./images/blazor_combobox_observable-collection.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBgCBVcAmhLLFOi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with observable collection data binding](./images/blazor_combobox_observable-collection.png)" %} ## Entity Framework diff --git a/blazor/combobox/form-validation.md b/blazor/combobox/form-validation.md index abe30cfd3c..b82824ab2d 100644 --- a/blazor/combobox/form-validation.md +++ b/blazor/combobox/form-validation.md @@ -29,6 +29,4 @@ When the ComboBox input is valid, the form is ready to be submitted. If the inpu {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hXrKWVrGUcRBhJQE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox inside editform](./images/form-validation/blazor_combobox_inside-editform.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hXrKWVrGUcRBhJQE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox inside editform](./images/form-validation/blazor_combobox_inside-editform.png)" %} \ No newline at end of file diff --git a/blazor/combobox/grouping.md b/blazor/combobox/grouping.md index 61b9ff9d7f..5101ed8d24 100644 --- a/blazor/combobox/grouping.md +++ b/blazor/combobox/grouping.md @@ -23,9 +23,7 @@ In the following sample, vegetables are grouped according to their category usin {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BXrAsLhwUmUFCjYX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Grouping in Blazor ComboBox](./images/blazor-combobox-grouping.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXrAsLhwUmUFCjYX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Grouping in Blazor ComboBox](./images/blazor-combobox-grouping.png)" %} ## Fixed group header diff --git a/blazor/combobox/how-to/tooltip.md b/blazor/combobox/how-to/tooltip.md index 268dd29ea1..70245ebd57 100644 --- a/blazor/combobox/how-to/tooltip.md +++ b/blazor/combobox/how-to/tooltip.md @@ -64,6 +64,4 @@ The following code demonstrates how to display a tooltip when hovering over the } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/htrqMBVwKYqDMxaA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Combobox displays Tooltip for Dropdown Items](../images/blazor-combobox-tooltip.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/htrqMBVwKYqDMxaA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Combobox displays Tooltip for Dropdown Items](../images/blazor-combobox-tooltip.png)" %} \ No newline at end of file diff --git a/blazor/combobox/style.md b/blazor/combobox/style.md index 7ff0e9e5d1..04131eee28 100644 --- a/blazor/combobox/style.md +++ b/blazor/combobox/style.md @@ -21,9 +21,7 @@ Specify the boolean value to the [Readonly](https://help.syncfusion.com/cr/blazo {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXVAiBLQUvNGLyuy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with Readonly mode](./images/style/blazor_combobox_readonly-mode.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXVAiBLQUvNGLyuy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with Readonly mode](./images/style/blazor_combobox_readonly-mode.png)" %} ## Disabled state @@ -67,9 +65,7 @@ You can customize the text color of a disabled component by targeting its CSS cl {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhqMVBwUFMudrwO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with Disabled component text color](./images/style/blazor_combobox_disabled-text-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhqMVBwUFMudrwO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with Disabled component text color](./images/style/blazor_combobox_disabled-text-color.png)" %} ## Customizing the appearance of container element @@ -81,9 +77,7 @@ You can customize the appearance of the container element within the ComboBox co {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hXhqirLQUlXaeBFy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox container element customization](./images/style/blazor_combobox_appearance-of-container.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hXhqirLQUlXaeBFy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox container element customization](./images/style/blazor_combobox_appearance-of-container.png)" %} ## Customizing the dropdown icon’s color @@ -95,9 +89,7 @@ You can customize the dropdown [icon](https://ej2.syncfusion.com/documentation/a {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BjrqMBVQKbirhlfh?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox icon color](./images/style/blazor_combobox_icon-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjrqMBVQKbirhlfh?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox icon color](./images/style/blazor_combobox_icon-color.png)" %} ## Customizing the focus color @@ -109,9 +101,7 @@ You can customize the component color when it is focused by targeting its CSS cl {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLUsVhGUFizesmJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox focus color](./images/style/blazor_combobox_focus-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtLUsVhGUFizesmJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox focus color](./images/style/blazor_combobox_focus-color.png)" %} ## Customizing the outline theme's focus color @@ -123,9 +113,7 @@ You can customize the color of the combobox component when it is in a focused st {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LjhqsVBQKFiQpUgc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox focusing color outline theme](./images/style/blazor_combobox_outline-focus-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LjhqsVBQKFiQpUgc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox focusing color outline theme](./images/style/blazor_combobox_outline-focus-color.png)" %} ## Customizing the background color of focus, hover, and active items @@ -137,9 +125,7 @@ You can customize the background color and text color of list items within the c {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZhKWhLwgPKXzzDZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with customizing the focus, hover and active item color](./images/style/blazor_combobox_background-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZhKWhLwgPKXzzDZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with customizing the focus, hover and active item color](./images/style/blazor_combobox_background-color.png)" %} ## Customizing the appearance of pop-up element @@ -151,9 +137,7 @@ You can customize the appearance of the popup element within the combobox compon {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BjhqiBVmUPKLSlDK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with customizing popup color](./images/style/blazor_combobox_appearance-of-popup.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjhqiBVmUPKLSlDK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with customizing popup color](./images/style/blazor_combobox_appearance-of-popup.png)" %} ## Change the HTML attributes @@ -225,9 +209,7 @@ You can change the text color of the floating label when it is focused by target {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhUsLhGgPhWFokH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with float label focusing color](./images/style/blazor_combobox_floatlabel-focus-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhUsLhGgPhWFokH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with float label focusing color](./images/style/blazor_combobox_floatlabel-focus-color.png)" %} ## Customizing the color of the placeholder text @@ -239,9 +221,7 @@ You can change the color of the placeholder by targeting its CSS class `input.e- {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjVKMrVQqbhTKwJQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with color placeholder](./images/style/blazor_combobox_placeholder-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjVKMrVQqbhTKwJQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with color placeholder](./images/style/blazor_combobox_placeholder-color.png)" %} ## Customizing the placeholder to add mandatory indicator(*) @@ -253,9 +233,7 @@ The mandatory indicator `*` can be applied to the placeholder by targeting its C {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVAsVhmKPrHruAI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with mandatory indicator placeholder](./images/style/blazor_combobox_placeholder-with-mandatory.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVAsVhmKPrHruAI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with mandatory indicator placeholder](./images/style/blazor_combobox_placeholder-with-mandatory.png)" %} ## Customizing the text selection color @@ -267,6 +245,4 @@ The appearance of a selected item within a combobox component can be customized {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BNLKCVBGgPVvrliw?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with customizing the focus, hover and active item color](./images/style/blazor_combobox_text-selection-color.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNLKCVBGgPVvrliw?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with customizing the focus, hover and active item color](./images/style/blazor_combobox_text-selection-color.png)" %} \ No newline at end of file diff --git a/blazor/combobox/templates.md b/blazor/combobox/templates.md index d89b53bd35..a892086086 100644 --- a/blazor/combobox/templates.md +++ b/blazor/combobox/templates.md @@ -27,9 +27,7 @@ In the following sample, each list item is split into two columns to display rel {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rNVAWhhQgcQzSVPf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with ItemTemplate](./images/blazor-combobox-item-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rNVAWhhQgcQzSVPf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with ItemTemplate](./images/blazor-combobox-item-template.png)" %} ## Group template @@ -43,9 +41,7 @@ In the following sample, employees are grouped according to their country. {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rNVKWBVmqQwncaKF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with GroupTemplate](./images/blazor-combobox-group-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rNVKWBVmqQwncaKF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with GroupTemplate](./images/blazor-combobox-group-template.png)" %} ## Header template @@ -59,9 +55,7 @@ In the following sample, the list items and its headers are designed and display {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LNVUsLhwAcwvaAlF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with HeaderTemplate](./images/blazor-combobox-header-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LNVUsLhwAcwvaAlF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with HeaderTemplate](./images/blazor-combobox-header-template.png)" %} ## Footer template @@ -75,9 +69,7 @@ In the following sample, footer element displays the total number of list items {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BtBKWVVwAcviULco?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with FooterTemplate](./images/blazor-combobox-footer-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BtBKWVVwAcviULco?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with FooterTemplate](./images/blazor-combobox-footer-template.png)" %} ## No records template @@ -91,9 +83,7 @@ In the following sample, popup list content displays the notification of no data {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hZVgWBrwUQlgRDZE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox without Data](./images/blazor-combobox-without-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hZVgWBrwUQlgRDZE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox without Data](./images/blazor-combobox-without-data.png)" %} ## Action failure template @@ -107,9 +97,7 @@ In the following sample, when the data fetch request fails, the ComboBox display {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VtBUMrrcqQlwxTci?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with Action Failure Template](./images/blazor-combobox-action-failure-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtBUMrrcqQlwxTci?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with Action Failure Template](./images/blazor-combobox-action-failure-template.png)" %} ## Combine two fields without Templates @@ -125,6 +113,4 @@ In the `GameFields` class, the `Name` property is defined with the `get` and `se {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rjLKMLBwAQaWEhfL?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Text with firstName and lastName](./images/templates/blazor_combobox_firstname-lastname.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/rjLKMLBwAQaWEhfL?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Text with firstName and lastName](./images/templates/blazor_combobox_firstname-lastname.png)" %} \ No newline at end of file diff --git a/blazor/combobox/virtualization.md b/blazor/combobox/virtualization.md index d5b1e302d8..669d677bfd 100644 --- a/blazor/combobox/virtualization.md +++ b/blazor/combobox/virtualization.md @@ -21,9 +21,7 @@ This feature is applicable to both local and remote data scenarios, providing fl {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBgCVBQqlgGofzc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor ComboBox with virtualization](./images/blazor_combobox_virtualization.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBgCVBQqlgGofzc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor ComboBox with virtualization](./images/blazor_combobox_virtualization.gif)" %} ## Remote data diff --git a/blazor/common/adding-script-references.md b/blazor/common/adding-script-references.md index 891eaa5162..d2868302ec 100644 --- a/blazor/common/adding-script-references.md +++ b/blazor/common/adding-script-references.md @@ -17,7 +17,7 @@ N> JavaScript interop files are required for features that cannot be implemented You can refer the Syncfusion® Blazor scripts using the CDN resources. -* For **.NET 8 and .NET 9** Blazor Web App (any render mode: Server, WebAssembly, or Auto), add scripts in `~/Components/App.razor`. +* For **.NET 8, .NET 9 and .NET 10** Blazor Web App (any render mode: Server, WebAssembly, or Auto), add scripts in `~/Components/App.razor`. * For a **Blazor WebAssembly (standalone) App**, add scripts in `~/wwwroot/index.html`. Syncfusion® Blazor components are available on the CDN per version. Ensure the version in the URLs matches the NuGet package version used in the application. diff --git a/blazor/common/cdn-fallback.md b/blazor/common/cdn-fallback.md index cfc1a3a855..c8eed92f0f 100644 --- a/blazor/common/cdn-fallback.md +++ b/blazor/common/cdn-fallback.md @@ -13,7 +13,7 @@ This section explains how to reference fallback [scripts](https://blazor.syncfus ## Blazor Web App -For **.NET 8 and .NET 9** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), reference script and stylesheet fallback from [Static Web Assets](https://blazor.syncfusion.com/documentation/common/adding-script-references#static-web-assets) as shown below. +For **.NET 8, .NET 9 and .NET 10** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), reference script and stylesheet fallback from [Static Web Assets](https://blazor.syncfusion.com/documentation/common/adding-script-references#static-web-assets) as shown below. ### Script fallback diff --git a/blazor/common/content-security-policy.md b/blazor/common/content-security-policy.md index 94c136eccb..6913c8de16 100644 --- a/blazor/common/content-security-policy.md +++ b/blazor/common/content-security-policy.md @@ -22,7 +22,7 @@ Include the following directives in the CSP policy for Syncfusion® Blazor Components +# Bind Data from SQL Server to Syncfusion® Blazor Components In this section, you can learn how to retrieve data from SQL database using [Entity Framework](https://learn.microsoft.com/en-us/ef/core/) to bind it to the Grid component and perform CRUD operations. Entity Framework is an open-source object-relational mapper (O/RM) from Microsoft. Entity Framework works with many databases. But here, we are going to discuss the step-by-step procedure to create an Entity Framework using the [MS SQL Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) database and connect it to the Syncfusion® component to perform CRUD operations in a Blazor Server Application. @@ -508,7 +508,7 @@ Themes provide life to components. Syncfusion®` of **~/Components/App.razor** file for .NET 9 and .NET 8. + * For **Blazor Web App**, refer stylesheet inside the `` of **~/Components/App.razor** file for .NET 10, .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 diff --git a/blazor/common/data-binding/sql-server-data-binding.md b/blazor/common/data-binding/sql-server-data-binding.md index 07b258e197..16d956ae0c 100644 --- a/blazor/common/data-binding/sql-server-data-binding.md +++ b/blazor/common/data-binding/sql-server-data-binding.md @@ -413,7 +413,7 @@ Themes provide life to components. Syncfusion®` of **~/Components/App.razor** . + * For **.NET 8, .NET 9 and .NET 10** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), refer stylesheet inside the `` of **~/Components/App.razor** . * For **Blazor WebAssembly application**, refer stylesheet inside the `` element of **wwwroot/index.html** file. @@ -456,7 +456,7 @@ If you have set the interactivity location to `Per page/component` in the web ap ## Binding SQL data to the Blazor DataGrid Component -Now, get the SQL data from the SQL server and bind it to the DataGrid component as a datasource by using the Custom adaptor feature. The Custom Adaptor can be created as a [Component](https://blazor.syncfusion.com/documentation/datagrid/custom-binding#custom-adaptor-as-component). Refer the [Grid Custom Binding](https://blazor.syncfusion.com/documentation/datagrid/custom-binding) and [Custom adaptor as component](https://blazor.syncfusion.com/documentation/datagrid/custom-binding#custom-adaptor-as-component) documentation for more details on the Custom adaptor. +Now, get the SQL data from the SQL server and bind it to the DataGrid component as a datasource by using the Custom adaptor feature. The Custom Adaptor can be created as a [Component](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor). Refer the [Grid Custom Binding](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor#data-binding) and [Custom adaptor as component](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor) documentation for more details on the Custom adaptor. Grid columns can be defined using the [GridColumn](https://blazor.syncfusion.com/documentation/datagrid/columns) component. Create columns using the following code. The properties used and their usage are discussed below. diff --git a/blazor/common/data-binding/webapi-service-binding.md b/blazor/common/data-binding/webapi-service-binding.md index fa77e81095..7dc70bc1d9 100644 --- a/blazor/common/data-binding/webapi-service-binding.md +++ b/blazor/common/data-binding/webapi-service-binding.md @@ -19,7 +19,7 @@ To enable the OData query option for Web API, Refer to this [documentation](http 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 or .NET 10 ## Create the database @@ -218,7 +218,7 @@ namespace WebAPICRUDServerApp * Now, open **Program.cs** file and add **AddControllers & MapControllers** method as follows. {% tabs %} -{% highlight c# tabtitle=".NET 9 & .NET 8 (~/Program.cs)" %} +{% highlight c# tabtitle=".NET 10, .NET 9 & .NET 8 (~/Program.cs)" %} ...... builder.Services.AddControllers(); @@ -472,7 +472,7 @@ Themes provide life to components. Syncfusion®` of **~/Components/App.razor** file for .NET 9 and .NET 8. +* For **Blazor Web App**, refer stylesheet inside the `` of **~/Components/App.razor** file for .NET 10, .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. diff --git a/blazor/common/deployment/deployment-linux-nginx.md b/blazor/common/deployment/deployment-linux-nginx.md new file mode 100644 index 0000000000..f17bdf89e3 --- /dev/null +++ b/blazor/common/deployment/deployment-linux-nginx.md @@ -0,0 +1,110 @@ +--- +layout: post +title: Deploy a Blazor Web App to Linux with NGINX | Syncfusion +description: Learn here all about deploying the Blazor Web App with Syncfusion Blazor Components to Linux server using NGINX. +platform: Blazor +component: Common +documentation: ug +--- + +# Deploy Blazor Web App to Linux with NGINX + +This section provides information about deploying a Blazor Web applications with the Syncfusion Blazor components to Linux server using NGINX as a reverse proxy. + +Refer to [Host ASP.NET Core on Linux with NGINX](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu) topic for more information. + +## Prerequisites + +* Linux Server – Ubuntu 20.04, Red Hat Enterprise (RHEL) 8.0 and SUSE Linux Enterprise Server 12. +* [.NET runtime](https://blazor.syncfusion.com/documentation/system-requirements#net-sdk) installed on the server. +* An existing Blazor Web App with Syncfusion components or create a new one. + +## Install and Start NGINX + +Install NGINX on your Linux system and enable it to start automatically: + +```bash +sudo dnf install nginx +sudo systemctl start nginx +sudo systemctl enable nginx +sudo systemctl status nginx +``` + +**Verification**: Open `http://your-server-ip` in a browser — you should see the NGINX welcome page. + +## Create and publish Your Blazor Web App with Syncfusion Components + +* You can create a Blazor Web App using the .NET CLI commands with Syncfusion components by referring [here](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=.net-cli). + +* Publish your Blazor Web application in Release configuration using the following command and run it: + +```bash +dotnet publish -c Release -o publish +cd publish +dotnet SfBlazorApp.dll --urls "http://0.0.0.0:5000" +``` + +![Publish Blazor Web App](../images/publish-blazor-app.jpg) + +## Configure NGINX to Proxy Requests + +Create a new NGINX configuration file for your Blazor application: + +```bash +sudo nano /etc/nginx/conf.d/blazorapp.conf +``` + +Add the following configuration to enable NGINX to act as a reverse proxy: + +```nginx +server { + listen 80; + server_name _; + location / { + proxy_pass http://localhost:5000; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} +``` + +Save and exit the file (Ctrl+O, Enter, then Ctrl+X). + +## Validate and Restart NGINX + +Test the NGINX configuration and restart the service: + +```bash +sudo nginx -t +sudo systemctl restart nginx +``` + +## Configure SELinux (For Red Hat-based Systems) + +On Red Hat-based systems, SELinux may block NGINX from accessing your Blazor app. Allow NGINX to connect to network services: + +```bash +sudo setsebool -P httpd_can_network_connect 1 +``` + +## Access the Application + +From your Windows machine or any other device, open a browser and navigate to: + +``` +http:/// +``` + +You should now see your Blazor Web app running successfully with Syncfusion components! + +![Output-Linux](../images/output-linux.png) + +## See also + +* [Host ASP.NET Core on Linux with NGINX](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0) +* [Configure NGINX for ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0#configure-nginx) 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 e671006d4b..694b184813 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 @@ -13,7 +13,7 @@ Use the following checklist to upgrade Syncfusion® ## 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 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) or [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.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 diff --git a/blazor/common/images/output-linux.png b/blazor/common/images/output-linux.png new file mode 100644 index 0000000000..4064e734d1 Binary files /dev/null and b/blazor/common/images/output-linux.png differ diff --git a/blazor/common/images/publish-blazor-app.jpg b/blazor/common/images/publish-blazor-app.jpg new file mode 100644 index 0000000000..9c3ee9997a Binary files /dev/null and b/blazor/common/images/publish-blazor-app.jpg differ diff --git a/blazor/common/localization.md b/blazor/common/localization.md index e0af46a0ab..ecc91bfab2 100644 --- a/blazor/common/localization.md +++ b/blazor/common/localization.md @@ -102,7 +102,7 @@ In Blazor Web App and Blazor WebAssembly (WASM) apps, set culture either in Blaz Set the app’s culture in JavaScript by configuring `applicationCulture` in Blazor’s start options: -* For **.NET 8 and .NET 9** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), prevent Blazor autostart by adding `autostart="false"` to the Blazor ` - //Blazor File Upload Component script reference. + ``` N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Blazor File Upload component +## Add Syncfusion® Blazor File Upload component + +The Syncfusion Blazor File Upload component allows you to seamlessly integrate file upload functionalities into your Blazor applications. It supports various features like asynchronous and synchronous uploads, file type validation, progress tracking, and custom templates. A common use case is enabling users to upload documents, images, or other files to a server, or process them directly within the client-side application. + +### Simple Code to render a Usable File Upload Component Add the Syncfusion® Blazor File Upload component in the **~/Pages/Index.razor** file. +The most basic way to render the File Upload component is by adding the `` tag to your `.razor` page. By default, this component provides a clean interface for users to select files locally. + {% tabs %} {% highlight razor %} @@ -165,39 +171,65 @@ Refer [here](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/devi N> If you encounter any errors while using the Android Emulator, refer to the following link for troubleshooting guidance[Troubleshooting Android Emulator](https://learn.microsoft.com/en-us/dotnet/maui/android/emulator/troubleshooting). -![Blazor FileUpload Component](./images/blazor-fileupload-component.png) -## Without server-side API endpoint +* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor FileUpload Component](./images/blazor-fileupload-component.png)" %} + +* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. -You can upload the files and files of folders in the Blazor application without specifying the server-side API end point using [AsyncSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html). +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor FileUpload Component](./images/blazor-fileupload-component.png)" %} -### Save and Remove actions +![Blazor File Upload Basic Component](images/blazor-fileupload-basic.gif) -You can get the uploaded files as file stream in the [ValueChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event argument. Now, you can write the save handler inside ValueChange event to save the files to desired location. Find the save action code below. +## Use ValueChange Event + +The [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event fires when files are selected or removed from the uploader. This event is crucial for client-side processing of selected files, allowing you to access file details and their content, which is useful for previewing files or handling uploads without a server-side endpoint. + +### Code Example + +This example demonstrates how to use the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event to save uploaded files directly to a local directory when the [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload) property is set to `true`. This is useful for scenarios where you want to process files immediately after selection without an explicit upload button. {% tabs %} {% highlight razor %} @using Syncfusion.Blazor.Inputs +@using System.IO + + @code { private async Task OnChange(UploadChangeEventArgs args) { try { - foreach (var file in args.Files) + foreach (var fileEntry in args.Files) { - var path = @"" + file.FileInfo.Name; - FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write); - await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream); - filestream.Close(); + // Define a path where you want to save the file. + // For a Blazor Server app, this path will be on the server. + var uploadsFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads"); + if (!Directory.Exists(uploadsFolder)) + { + Directory.CreateDirectory(uploadsFolder); + } + + // Construct the full file path. + var filePath = Path.Combine(uploadsFolder, fileEntry.FileInfo.Name); + + // Use a FileStream to write the uploaded file's content to the server. + await using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) + { + // OpenReadStream with long.MaxValue allows reading the entire stream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(fileStream); + } + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' saved successfully to '{filePath}'"); } } catch (Exception ex) { - Console.WriteLine(ex.Message); + Console.WriteLine($"Error saving file: {ex.Message}"); } } } @@ -205,20 +237,71 @@ You can get the uploaded files as file stream in the [ValueChange](https://help. {% endhighlight %} {% endtabs %} -![Blazor FileUpload displays Updated Files](./images/blazor-fileupload-with-updated-files.png) +N> When saving files directly in a Blazor Server application using [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) and [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload), the files are saved on the server where the Blazor Server app is running, not on the client's machine. You need appropriate file system permissions for the server process to write to the specified directory. Also, ensure the target directory (`wwwroot/uploads` in this example) exists or is created programmatically. In a production environment, consider secure storage solutions for uploaded files. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDVyZkrqBvaSlvht?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload ValueChange Event](images/blazor-fileupload-valuechange.gif) + -While clicking on the remove icon in the file list, you will get the [OnRemove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnRemove) event with removing file name as argument. So, you can write the remove handler inside OnRemove event to remove the particular file from desired location. Find the remove action code below. +## Memory stream + +When you need to process uploaded files in memory—perhaps for resizing images, reading content, or sending them to another service without saving them to disk first—using a `MemoryStream` is an efficient approach. This is particularly useful for temporary processing or when dealing with sensitive data that shouldn't persist on the file system. + +### Code Example + +This example demonstrates how to read the content of an uploaded file into a [MemoryStream Class](https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream)`. This allows you to perform in-memory operations on the file, such as converting an image to a Base64 string, without requiring disk I/O. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} + +@using Syncfusion.Blazor.Inputs +@using System.IO -Private void onRemove(RemovingEventArgs args) + + + + +@if (!string.IsNullOrEmpty(base64Image)) { - foreach(var removeFile in args.FilesData) +

    Uploaded Image Preview (Base64)

    + +} + +@code { + private string base64Image; + + private async Task OnValueChangeMemoryStream(UploadChangeEventArgs args) { - if (File.Exists(Path.Combine(@"rootPath", removeFile.Name))) + base64Image = string.Empty; // Clear previous image + + foreach (var fileEntry in args.Files) { - File.Delete(Path.Combine(@"rootPath", removeFile.Name)) + if (fileEntry.FileInfo.Type.StartsWith("image/", StringComparison.OrdinalIgnoreCase)) + { + // Create a MemoryStream to hold the file content. + using var memoryStream = new MemoryStream(); + + // Copy the file's content from the upload stream to the MemoryStream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(memoryStream); + + // Convert the MemoryStream content to a byte array. + byte[] imageBytes = memoryStream.ToArray(); + + // Convert byte array to Base64 string for display or further processing. + base64Image = Convert.ToBase64String(imageBytes); + Console.WriteLine($"Image '{fileEntry.FileInfo.Name}' loaded into MemoryStream and converted to Base64."); + } + else + { + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' is not an image and won't be processed for Base64 preview."); + // For non-image files, you could read their content as text or handle differently. + // Example for text file: + // memoryStream.Position = 0; // Reset stream position + // using var reader = new StreamReader(memoryStream); + // var content = await reader.ReadToEndAsync(); + // Console.WriteLine($"Content of {fileEntry.FileInfo.Name}: {content}"); + } } } } @@ -226,109 +309,138 @@ Private void onRemove(RemovingEventArgs args) {% endhighlight %} {% endtabs %} -## With server-side API endpoint +N> When using `MemoryStream` for large files, be mindful of server memory consumption. If you expect very large files, consider processing them in chunks or saving them to temporary storage before processing to avoid out-of-memory exceptions. The `long.MaxValue` in `OpenReadStream` indicates the maximum buffer size. In a Blazor Server app, `Stream` operations occur on the server. -The upload process requires save and remove action URL to manage the upload process in the server. +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjreNaLUhdwxzvHS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -N> * The save action is necessary to handle the upload operation. -
    * The remove action is optional, one can handle the removed files from server. +![Blazor File Upload Memory Stream Example](images/blazor-fileupload-memorystream.gif) -The save action handler upload the files that needs to be specified in the [SaveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_SaveUrl) property. -The save handler receives the submitted files and manages the save process in server. After uploading the files to server location, the color of the selected file name changes to green and the remove icon is changed as bin icon. +## Created Event -The remove action is optional. The remove action handler removes the files that needs to be specified in the [RemoveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_RemoveUrl) property. [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnActionComplete) event triggers after all the selected files have been processed to upload successfully or failed to server. +The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event fires after the File Upload component has been rendered and initialized. This event is a good place to perform any initial setup, attach custom event listeners to the component's DOM elements, or apply custom styling that requires the component to be fully rendered. + +### Code Example + +This example shows how to use the [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event to add a custom message or dynamically change some aspect of the uploader's appearance right after it's created. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} -[Route("api/[controller]")] -public class SampleDataController : Controller -{ - public string uploads = ".\\Uploaded Files"; // replace with your directory path +@using Syncfusion.Blazor.Inputs - [HttpPost("[action]")] - public async Task Save(IFormFile UploadFiles) // Save the uploaded file here - { - if (UploadFiles.Length > 0) - { - //Create directory if not exists - if (!Directory.Exists(uploads)) - { - Directory.CreateDirectory(uploads); - } + + + - var filePath = Path.Combine(uploads, UploadFiles.FileName); - if (System.IO.File.Exists(filePath)) - { - //Return conflict status code - return new StatusCodeResult(StatusCodes.Status409Conflict); - } - using (var fileStream = new FileStream(filePath, FileMode.Create)) - { - //Save the uploaded file to server - await UploadFiles.CopyToAsync(fileStream); - } - } - return Ok(); - } +

    @statusMessage

    +@code { + private string statusMessage = "Uploader not yet created."; - [HttpPost("[action]")] - public void Remove(string UploadFiles) // Delete the uploaded file here + private void OnUploaderCreated() { - if(UploadFiles != null) - { - var filePath = Path.Combine(uploads, UploadFiles); - if (System.IO.File.Exists(filePath)) - { - //Delete the file from server - System.IO.File.Delete(filePath); - } - } + statusMessage = "Syncfusion File Uploader has been successfully created and initialized!"; + Console.WriteLine(statusMessage); + // You could also interact with JavaScript to modify DOM here if needed. + // For example: JSRuntime.InvokeVoidAsync("someJsFunction"); } } {% endhighlight %} {% endtabs %} -The [OnFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFailure) event is triggered when there is a failure in the AJAX request during the uploading or removing of files. It provides a way to handle and respond to any errors or issues that occur during the file upload or removal process. +N> The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event is useful for client-side JavaScript interop if you need to manipulate the DOM elements of the uploader component immediately after it's ready. However, for most Blazor-specific customizations (like custom templates), you should use the built-in Blazor features. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLyNuVUBGtPZrdo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Created Example](images/blazor-fileupload-created.gif) + + +## File Selected Event + +The [`FileSelected Event`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected)event is triggered when files are chosen from the file explorer dialog, but **before** the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event. This event provides an opportunity to perform validations on the selected files (e.g., file size, type, count) and decide whether to proceed with the upload/value change or cancel the selection. It's ideal for immediate client-side feedback or preventative actions. + +### Code Example + +This example demonstrates how to use the [FileSelected Event](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected) event to prevent files larger than a certain size. {% tabs %} {% highlight razor %} - - - +@using Syncfusion.Blazor.Inputs +@using System.Linq + + + +

    @validationMessage

    + @code { - private void OnFailureHandler(FailureEventArgs args) - { - // Here, you can customize your code. - } - private void OnActionCompleteHandler(ActionCompleteEventArgs args) + private string validationMessage = ""; + private readonly long MaxFileSize = 1024 * 1024; // 1 MB + + private void OnFileSelected(SelectedEventArgs args) { - // Here, you can customize your code. + validationMessage = ""; + foreach (var file in args.FilesData) + { + if (file.Size > MaxFileSize) + { + validationMessage += $"Error: File '{file.Name}' exceeds {MaxFileSize / (1024 * 1024)} MB limit. "; + args.Cancel = true; // Prevents this file from being added + } + } + if (!string.IsNullOrEmpty(validationMessage)) + { + Console.WriteLine(validationMessage); + } + else + { + Console.WriteLine("Files selected successfully and passed initial validation."); + } } } {% endhighlight %} {% endtabs %} -## Configure allowed file types +N> Setting `args.Cancel = true` in the `FileSelected` event will prevent the file (or files if `args.Files` contains multiple) from being added to the uploader's internal file list. This is a client-side validation and should be complemented with server-side validation for robust security and data integrity. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLIZuBUVwEJoJpz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload File Selected Example](images/blazor-fileupload-fileselected.gif) + + +## OnFileListRender -You can allow the specific files alone to upload using the [AllowedExtensions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderModel.html#Syncfusion_Blazor_Inputs_UploaderModel_AllowedExtensions) property. The extension can be represented as collection by comma separators. The uploader component filters the selected or dropped files to match against the specified file types and processes the upload operation. The validation happens when you specify value to inline attribute to accept the original input element. +The [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) event allows you to customize individual file list items before they are rendered in the uploader's UI. This is highly useful for scenarios where you need to display additional information alongside each file, such as a custom preview, metadata, or actions. + +### Code Example + +This example demonstrates how to use [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) {% tabs %} {% highlight razor %} - +@using Syncfusion.Blazor.Inputs + + + + + + +@code { + SfUploader fileobj; + private void OnFileListRenderHandler(FileListRenderingEventArgs args) + { + + } +} {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhzDsrOqbKVNviI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Allowing Specific Files in Blazor FileUpload](./images/blazor-fileupload-allow-specific-file.png)" %} - N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload). ## See also @@ -336,4 +448,5 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting- 1. [Getting Started with Syncfusion® Blazor for client-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-dotnet-cli) 2. [Getting Started with Syncfusion® Blazor for client-side in Visual Studio](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-visual-studio) 3. [Getting Started with Syncfusion® Blazor for server-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-dotnet-cli) -4. [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) \ No newline at end of file +4. [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) +5. [How to convert images to Base64 string with Blazor File Upload](https://support.syncfusion.com/kb/article/21178/how-to-convert-images-to-base64-string-with-blazor-file-upload) diff --git a/blazor/file-upload/getting-started-with-server-app.md b/blazor/file-upload/getting-started-with-server-app.md index 5943ebd4bf..f74d7ecccf 100644 --- a/blazor/file-upload/getting-started-with-server-app.md +++ b/blazor/file-upload/getting-started-with-server-app.md @@ -7,11 +7,11 @@ control: FileUpload documentation: ug --- -# Getting Started with Blazor File Upload Component in Server App +# Getting Started with Blazor File Upload Component -This section briefly explains about how to include [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-tree-grid) component in your Blazor Server App using Visual Studio, Visual Studio Code and .NET CLI. +This section briefly explains how to include the [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-tree-grid) component in your Blazor Server Application using Visual Studio, Visual Studio Code, and the .NET CLI. -To get start quickly with Blazor File Upload, you can check on this [GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload) sample: +To get started quickly with the Blazor File Upload, you can check out this [GitHub sample](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload). {% tabcontents %} @@ -19,15 +19,15 @@ To get start quickly with Blazor File Upload, you can check on this [GitHub](htt ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor App in Visual Studio -You can create a **Blazor Server App** using **Blazor Web App** template in Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vs) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). For detailed instructions, refer to [this Blazor Server App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) documentation. +You can create a **Blazor Server App** using the **Blazor Web App** template in Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vs) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). For detailed instructions, refer to [this Blazor Server App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) documentation. ## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -To add **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). Alternatively, you can utilize the following package manager command to achieve the same. +To add the **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). Alternatively, you can utilize the following package manager command to achieve the same. {% tabs %} {% highlight C# tabtitle="Package Manager" %} @@ -46,7 +46,7 @@ N> Syncfusion® Blazor components are availa ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor App in Visual Studio Code @@ -67,9 +67,9 @@ cd BlazorApp ## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -* Press Ctrl+` to open the integrated terminal in Visual Studio Code. -* Ensure you’re in the project root directory where your `.csproj` file is located. -* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. +* Press Ctrl+` to open the integrated terminal in Visual Studio Code. +* Ensure you’re in the project root directory where your `.csproj` file is located. +* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. {% tabs %} @@ -103,7 +103,7 @@ dotnet --version ## Create a Blazor Server App using .NET CLI -Run the `dotnet new blazorserver` command to create a new Blazor Server App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). +Run the `dotnet new blazorserver` command to create a new Blazor Server application in a command prompt (Windows) or terminal (macOS) or command shell (Linux). {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -114,11 +114,11 @@ cd BlazorApp {% endhighlight %} {% endtabs %} -This command creates new Blazor Server App and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new) topics for more details. +This command creates a new Blazor app project and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new) topics for more details. ## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -Here's an example of how to add **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. +Here's an example of how to add the **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -149,7 +149,7 @@ Open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncf ## Register Syncfusion® Blazor Service -Register the Syncfusion® Blazor Service in the **~/Program.cs** file of your Blazor Server App. +Register the Syncfusion® Blazor Service in the **~/Program.cs** file of your Blazor Server App. {% tabs %} {% highlight C# tabtitle="~/Program.cs" hl_lines="3 10" %} @@ -186,13 +186,19 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A //Blazor File Upload Component script reference. - + ``` N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Blazor File Upload component +## Add Syncfusion® Blazor File Upload component + +The Syncfusion Blazor File Upload component allows you to seamlessly integrate file upload functionalities into your Blazor applications. It supports various features like asynchronous and synchronous uploads, file type validation, progress tracking, and custom templates. A common use case is enabling users to upload documents, images, or other files to a server, or process them directly within the client-side application. + +### Simple Code to render a Usable File Upload Component + +The most basic way to render the File Upload component is by adding the `` tag to your `.razor` page. By default, this component provides a clean interface for users to select files locally. Add the Syncfusion® Blazor File Upload component in the **~/Components/Pages/Home.razor** file. If an interactivity location as `per page/component`, define a render mode at the top of the `Home.razor` page. @@ -211,41 +217,60 @@ N> If an Interactivity Location is set to `Global` and the **Render Mode** is se {% endhighlight %} {% endtabs %} -* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. +* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor FileUpload Component](./images/blazor-fileupload-component.png)" %} +![Blazor File Upload Basic Component](images/blazor-fileupload-basic.gif) -## Without server-side API endpoint +## Use ValueChange Event -You can upload the files and files of folders in the Blazor application without specifying the server-side API end point using [AsyncSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html). +The [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event fires when files are selected or removed from the uploader. This event is crucial for client-side processing of selected files, allowing you to access file details and their content, which is useful for previewing files or handling uploads without a server-side endpoint. -### Save and Remove actions +### Code Example -You can get the uploaded files as file stream in the [ValueChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event argument. Now, you can write the save handler inside ValueChange event to save the files to desired location. Find the save action code below. +This example demonstrates how to use the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event to save uploaded files directly to a local directory when the [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload) property is set to `true`. This is useful for scenarios where you want to process files immediately after selection without an explicit upload button. {% tabs %} {% highlight razor %} @using Syncfusion.Blazor.Inputs +@using System.IO + + @code { private async Task OnChange(UploadChangeEventArgs args) { try { - foreach (var file in args.Files) + foreach (var fileEntry in args.Files) { - var path = @"" + file.FileInfo.Name; - FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write); - await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream); - filestream.Close(); + // Define a path where you want to save the file. + // For a Blazor Server app, this path will be on the server. + var uploadsFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads"); + if (!Directory.Exists(uploadsFolder)) + { + Directory.CreateDirectory(uploadsFolder); + } + + // Construct the full file path. + var filePath = Path.Combine(uploadsFolder, fileEntry.FileInfo.Name); + + // Use a FileStream to write the uploaded file's content to the server. + await using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) + { + // OpenReadStream with long.MaxValue allows reading the entire stream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(fileStream); + } + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' saved successfully to '{filePath}'"); } } catch (Exception ex) { - Console.WriteLine(ex.Message); + Console.WriteLine($"Error saving file: {ex.Message}"); } } } @@ -253,20 +278,71 @@ You can get the uploaded files as file stream in the [ValueChange](https://help. {% endhighlight %} {% endtabs %} -![Blazor FileUpload displays Updated Files](./images/blazor-fileupload-with-updated-files.png) +N> When saving files directly in a Blazor Server application using [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) and [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload), the files are saved on the server where the Blazor Server app is running, not on the client's machine. You need appropriate file system permissions for the server process to write to the specified directory. Also, ensure the target directory (`wwwroot/uploads` in this example) exists or is created programmatically. In a production environment, consider secure storage solutions for uploaded files. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDVyZkrqBvaSlvht?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload ValueChange Event](images/blazor-fileupload-valuechange.gif) + + +## Memory stream -While clicking on the remove icon in the file list, you will get the [OnRemove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnRemove) event with removing file name as argument. So, you can write the remove handler inside OnRemove event to remove the particular file from desired location. Find the remove action code below. +When you need to process uploaded files in memory—perhaps for resizing images, reading content, or sending them to another service without saving them to disk first—using a `MemoryStream` is an efficient approach. This is particularly useful for temporary processing or when dealing with sensitive data that shouldn't persist on the file system. + +### Code Example + +This example demonstrates how to read the content of an uploaded file into a [MemoryStream Class](https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream)`. This allows you to perform in-memory operations on the file, such as converting an image to a Base64 string, without requiring disk I/O. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} + +@using Syncfusion.Blazor.Inputs +@using System.IO -Private void onRemove(RemovingEventArgs args) + + + + +@if (!string.IsNullOrEmpty(base64Image)) { - foreach(var removeFile in args.FilesData) +

    Uploaded Image Preview (Base64)

    + +} + +@code { + private string base64Image; + + private async Task OnValueChangeMemoryStream(UploadChangeEventArgs args) { - if (File.Exists(Path.Combine(@"rootPath", removeFile.Name))) + base64Image = string.Empty; // Clear previous image + + foreach (var fileEntry in args.Files) { - File.Delete(Path.Combine(@"rootPath", removeFile.Name)) + if (fileEntry.FileInfo.Type.StartsWith("image/", StringComparison.OrdinalIgnoreCase)) + { + // Create a MemoryStream to hold the file content. + using var memoryStream = new MemoryStream(); + + // Copy the file's content from the upload stream to the MemoryStream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(memoryStream); + + // Convert the MemoryStream content to a byte array. + byte[] imageBytes = memoryStream.ToArray(); + + // Convert byte array to Base64 string for display or further processing. + base64Image = Convert.ToBase64String(imageBytes); + Console.WriteLine($"Image '{fileEntry.FileInfo.Name}' loaded into MemoryStream and converted to Base64."); + } + else + { + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' is not an image and won't be processed for Base64 preview."); + // For non-image files, you could read their content as text or handle differently. + // Example for text file: + // memoryStream.Position = 0; // Reset stream position + // using var reader = new StreamReader(memoryStream); + // var content = await reader.ReadToEndAsync(); + // Console.WriteLine($"Content of {fileEntry.FileInfo.Name}: {content}"); + } } } } @@ -274,114 +350,145 @@ Private void onRemove(RemovingEventArgs args) {% endhighlight %} {% endtabs %} -## With server-side API endpoint +N> When using `MemoryStream` for large files, be mindful of server memory consumption. If you expect very large files, consider processing them in chunks or saving them to temporary storage before processing to avoid out-of-memory exceptions. The `long.MaxValue` in `OpenReadStream` indicates the maximum buffer size. In a Blazor Server app, `Stream` operations occur on the server. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjreNaLUhdwxzvHS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Memory Stream Example](images/blazor-fileupload-memorystream.gif) -The upload process requires save and remove action URL to manage the upload process in the server. -N> * The save action is necessary to handle the upload operation. -
    * The remove action is optional, one can handle the removed files from server. +## Created Event -The save action handler upload the files that needs to be specified in the [SaveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_SaveUrl) property. +The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event fires after the File Upload component has been rendered and initialized. This event is a good place to perform any initial setup, attach custom event listeners to the component's DOM elements, or apply custom styling that requires the component to be fully rendered. -The save handler receives the submitted files and manages the save process in server. After uploading the files to server location, the color of the selected file name changes to green and the remove icon is changed as bin icon. +### Code Example -The remove action is optional. The remove action handler removes the files that needs to be specified in the [RemoveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_RemoveUrl) property. [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnActionComplete) event triggers after all the selected files have been processed to upload successfully or failed to server. +This example shows how to use the [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event to add a custom message or dynamically change some aspect of the uploader's appearance right after it's created. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} -[Route("api/[controller]")] -public class SampleDataController : Controller -{ - public string uploads = ".\\Uploaded Files"; // replace with your directory path +@using Syncfusion.Blazor.Inputs - [HttpPost("[action]")] - public async Task Save(IFormFile UploadFiles) // Save the uploaded file here - { - if (UploadFiles.Length > 0) - { - //Create directory if not exists - if (!Directory.Exists(uploads)) - { - Directory.CreateDirectory(uploads); - } + + + - var filePath = Path.Combine(uploads, UploadFiles.FileName); - if (System.IO.File.Exists(filePath)) - { - //Return conflict status code - return new StatusCodeResult(StatusCodes.Status409Conflict); - } - using (var fileStream = new FileStream(filePath, FileMode.Create)) - { - //Save the uploaded file to server - await UploadFiles.CopyToAsync(fileStream); - } - } - return Ok(); - } +

    @statusMessage

    +@code { + private string statusMessage = "Uploader not yet created."; - [HttpPost("[action]")] - public void Remove(string UploadFiles) // Delete the uploaded file here + private void OnUploaderCreated() { - if(UploadFiles != null) - { - var filePath = Path.Combine(uploads, UploadFiles); - if (System.IO.File.Exists(filePath)) - { - //Delete the file from server - System.IO.File.Delete(filePath); - } - } + statusMessage = "Syncfusion File Uploader has been successfully created and initialized!"; + Console.WriteLine(statusMessage); + // You could also interact with JavaScript to modify DOM here if needed. + // For example: JSRuntime.InvokeVoidAsync("someJsFunction"); } } {% endhighlight %} {% endtabs %} -The [OnFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFailure) event is triggered when there is a failure in the AJAX request during the uploading or removing of files. It provides a way to handle and respond to any errors or issues that occur during the file upload or removal process. +N> The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event is useful for client-side JavaScript interop if you need to manipulate the DOM elements of the uploader component immediately after it's ready. However, for most Blazor-specific customizations (like custom templates), you should use the built-in Blazor features. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLyNuVUBGtPZrdo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Created Example](images/blazor-fileupload-created.gif) + + +## File Selected Event + +The [`FileSelected Event`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected)event is triggered when files are chosen from the file explorer dialog, but **before** the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event. This event provides an opportunity to perform validations on the selected files (e.g., file size, type, count) and decide whether to proceed with the upload/value change or cancel the selection. It's ideal for immediate client-side feedback or preventative actions. + +### Code Example + +This example demonstrates how to use the [FileSelected Event](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected) event to prevent files larger than a certain size. {% tabs %} {% highlight razor %} - - - +@using Syncfusion.Blazor.Inputs +@using System.Linq + + + +

    @validationMessage

    + @code { - private void OnFailureHandler(FailureEventArgs args) - { - // Here, you can customize your code. - } - private void OnActionCompleteHandler(ActionCompleteEventArgs args) + private string validationMessage = ""; + private readonly long MaxFileSize = 1024 * 1024; // 1 MB + + private void OnFileSelected(SelectedEventArgs args) { - // Here, you can customize your code. + validationMessage = ""; + foreach (var file in args.FilesData) + { + if (file.Size > MaxFileSize) + { + validationMessage += $"Error: File '{file.Name}' exceeds {MaxFileSize / (1024 * 1024)} MB limit. "; + args.Cancel = true; // Prevents this file from being added + } + } + if (!string.IsNullOrEmpty(validationMessage)) + { + Console.WriteLine(validationMessage); + } + else + { + Console.WriteLine("Files selected successfully and passed initial validation."); + } } } {% endhighlight %} {% endtabs %} -## Configure allowed file types +N> Setting `args.Cancel = true` in the `FileSelected` event will prevent the file (or files if `args.Files` contains multiple) from being added to the uploader's internal file list. This is a client-side validation and should be complemented with server-side validation for robust security and data integrity. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLIZuBUVwEJoJpz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload File Selected Example](images/blazor-fileupload-fileselected.gif) + + +## OnFileListRender -You can allow the specific files alone to upload using the [AllowedExtensions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderModel.html#Syncfusion_Blazor_Inputs_UploaderModel_AllowedExtensions) property. The extension can be represented as collection by comma separators. The uploader component filters the selected or dropped files to match against the specified file types and processes the upload operation. The validation happens when you specify value to inline attribute to accept the original input element. +The [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) event allows you to customize individual file list items before they are rendered in the uploader's UI. This is highly useful for scenarios where you need to display additional information alongside each file, such as a custom preview, metadata, or actions. + +### Code Example + +This example demonstrates how to use [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) {% tabs %} {% highlight razor %} - +@using Syncfusion.Blazor.Inputs + + + + + + +@code { + SfUploader fileobj; + private void OnFileListRenderHandler(FileListRenderingEventArgs args) + { + + } +} {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhzDsrOqbKVNviI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Allowing Specific Files in Blazor FileUpload](./images/blazor-fileupload-allow-specific-file.png)" %} N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload). ## See also -1. [Getting Started with Syncfusion® Blazor for client-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-dotnet-cli) -2. [Getting Started with Syncfusion® Blazor for client-side in Visual Studio](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-visual-studio) -3. [Getting Started with Syncfusion® Blazor for server-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-dotnet-cli) -4. [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) \ No newline at end of file +1. [Getting Started with Syncfusion® Blazor for client-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-dotnet-cli) +2. [Getting Started with Syncfusion® Blazor for client-side in Visual Studio](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-visual-studio) +3. [Getting Started with Syncfusion® Blazor for server-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-dotnet-cli) +4. [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) +5. [How to convert images to Base64 string with Blazor File Upload](https://support.syncfusion.com/kb/article/21178/how-to-convert-images-to-base64-string-with-blazor-file-upload) diff --git a/blazor/file-upload/getting-started-with-web-app.md b/blazor/file-upload/getting-started-with-web-app.md index 53db73bd22..e40b214485 100644 --- a/blazor/file-upload/getting-started-with-web-app.md +++ b/blazor/file-upload/getting-started-with-web-app.md @@ -9,7 +9,7 @@ documentation: ug # Getting Started with Blazor File Upload Component in Web App -This section briefly explains about how to include [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-file-upload) component in your Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), Visual Studio Code and .NET CLI. +This section briefly explains how to include the [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-file-upload) component in your Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), Visual Studio Code, and .NET CLI. {% tabcontents %} @@ -17,7 +17,7 @@ This section briefly explains about how to include [Blazor File Upload](https:// ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor Web App in Visual Studio @@ -25,13 +25,11 @@ You can create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Temp 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=vs) while creating a Blazor Web Application. -![Create Blazor Web App](images/blazor-create-web-app.png) - ## Install Syncfusion® Blazor Inputs and Themes NuGet in the Blazor Web App -To add **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). +To add the **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) 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 you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install Syncfusion® Blazor components NuGet packages within the client project. Alternatively, you can utilize the following package manager command to achieve the same. @@ -52,7 +50,7 @@ N> Syncfusion® Blazor components are availa ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor Web App in Visual Studio Code @@ -63,7 +61,7 @@ Configure the appropriate interactive render mode and interactivity location whe For example, in a Blazor Web App with the `Auto` interactive render mode, use the following commands. {% tabs %} -{% highlight c# tabtitle="Blazor Web App" %} +{% highlight C# tabtitle="Blazor Web App" %} dotnet new blazor -o BlazorWebApp -int Auto cd BlazorWebApp @@ -72,17 +70,19 @@ cd BlazorWebApp.Client {% endhighlight %} {% endtabs %} +N> For more information on creating a **Blazor Web App** with various interactive modes and locations, refer to this [link](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=visual-studio-code#render-interactive-modes). + ## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -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 you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install Syncfusion® Blazor components NuGet packages within the client project. -* Press Ctrl+` to open the integrated terminal in Visual Studio Code. -* Ensure you’re in the project root directory where your `.csproj` file is located. -* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. +* Press Ctrl+` to open the integrated terminal in Visual Studio Code. +* Ensure you’re in the project root directory where your `.csproj` file is located. +* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. {% tabs %} -{% highlight c# tabtitle="Package Manager" %} +{% highlight C# tabtitle="Package Manager" %} dotnet add package Syncfusion.Blazor.Inputs -v {{ site.releaseversion }} dotnet add package Syncfusion.Blazor.Themes -v {{ site.releaseversion }} @@ -103,14 +103,14 @@ N> Syncfusion® Blazor components are availa Latest version of the [.NET Core SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux). {% tabs %} -{% highlight c# tabtitle=".NET CLI" %} +{% highlight C# tabtitle=".NET CLI" %} dotnet --version {% endhighlight %} {% endtabs %} -## Create a Blazor Web App using .NET CLI +## Create a Blazor Web project using .NET CLI Run the following command to create a new Blazor Web App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). For detailed instructions, refer to [this Blazor Web App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=.net-cli) documentation. @@ -119,7 +119,7 @@ Configure the appropriate interactive render mode and interactivity location whe For example, in a Blazor Web App with `Auto` interactive render mode, use the following commands: {% tabs %} -{% highlight c# tabtitle=".NET CLI" %} +{% highlight C# tabtitle=".NET CLI" %} dotnet new blazor -o BlazorApp -int Auto cd BlazorApp @@ -128,16 +128,16 @@ cd BlazorApp.Client {% endhighlight %} {% endtabs %} -This command creates new Blazor Web App and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?pivots=linux-macos&view=aspnetcore-8.0) topics for more details. +This command creates a new Blazor Web app project and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?pivots=linux-macos&view=aspnetcore-8.0) topics for more details. ## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -Here's an example of how to add **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. +Here's an example of how to add the **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. -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 you utilize `WebAssembly` or `Auto` render modes in the Blazor Web App, you need to install Syncfusion® Blazor components NuGet packages within the client project. {% tabs %} -{% highlight c# tabtitle=".NET CLI" %} +{% highlight C# tabtitle=".NET CLI" %} dotnet add package Syncfusion.Blazor.Inputs --version {{ site.releaseversion }} dotnet add package Syncfusion.Blazor.Themes --version {{ site.releaseversion }} @@ -154,7 +154,7 @@ N> Syncfusion® Blazor components are availa ## Add Import Namespaces -Open the **~/_Imports.razor** file from the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Inputs` namespace. +Open the **~/_Imports.razor** file from the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Inputs` namespaces. {% tabs %} {% highlight C# tabtitle="~/_Imports.razor" %} @@ -165,14 +165,14 @@ Open the **~/_Imports.razor** file from the client project and import the `Syncf {% endhighlight %} {% endtabs %} -## Register Syncfusion® Blazor Service +

    Register Syncfusion® Blazor Service

    Register the Syncfusion® Blazor Service in the **~/Program.cs** file of your Blazor Web App. If your Blazor Web App uses `WebAssembly` or `Auto` interactive render modes, you must register the Syncfusion® Blazor service in the **~/Program.cs** files of the main `server` project and associated `.Client` project. {% tabs %} -{% highlight c# tabtitle="Server(~/_Program.cs)" hl_lines="3 11" %} +{% highlight C# tabtitle="Server (~/Program.cs)" hl_lines="3 11" %} ... ... @@ -190,7 +190,7 @@ var app = builder.Build(); .... {% endhighlight %} -{% highlight c# tabtitle="Client(~/_Program.cs)" hl_lines="2 5" %} +{% highlight C# tabtitle="Client (~/Program.cs)" hl_lines="2 5" %} ... using Syncfusion.Blazor; @@ -203,7 +203,7 @@ await builder.Build().RunAsync(); {% endhighlight %} {% endtabs %} -## Add stylesheet and script resources +

    Add stylesheet and script resources

    The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the `` section and the script reference at the end of the `` in the **~/Components/App.razor** file as shown below: @@ -217,16 +217,20 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A .... - //Blazor File Upload Component script reference. - + + ``` N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Syncfusion® Blazor File Upload component +## Add Syncfusion® Blazor File Upload component -Add the Syncfusion® Blazor File Upload component to a Razor page located under the Pages folder (e.g., Pages/Home.razor) in either the **Server** or **Client** project. If an interactivity location as `Per page/component` in the web app, define a render mode at top of the component, as follows: +The Syncfusion Blazor File Upload component allows you to seamlessly integrate file upload functionalities into your Blazor applications. It supports various features like asynchronous and synchronous uploads, file type validation, progress tracking, and custom templates. A common use case is enabling users to upload documents, images, or other files to a server, or process them directly within the client-side application. + +### Simple Code to render a Usable File Upload Component + +The most basic way to render the File Upload component is by adding the `` tag to your `.razor` page. By default, this component provides a clean interface for users to select files locally. | Interactivity location | RenderMode | Code | | --- | --- | --- | @@ -253,41 +257,60 @@ N> If an **Interactivity Location** is set to `Global` and the **Render Mode** i {% endhighlight %} {% endtabs %} -* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. +* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor FileUpload Component](./images/blazor-fileupload-component.png)" %} +![Blazor File Upload Basic Component](images/blazor-fileupload-basic.gif) -## Without server-side API endpoint +## Use ValueChange Event -You can upload the files and files of folders in the Blazor application without specifying the server-side API end point using [AsyncSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html). +The [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event fires when files are selected or removed from the uploader. This event is crucial for client-side processing of selected files, allowing you to access file details and their content, which is useful for previewing files or handling uploads without a server-side endpoint. -### Save and Remove actions +### Code Example -You can get the uploaded files as file stream in the [ValueChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event argument. Now, you can write the save handler inside ValueChange event to save the files to desired location. Find the save action code below. +This example demonstrates how to use the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event to save uploaded files directly to a local directory when the [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload) property is set to `true`. This is useful for scenarios where you want to process files immediately after selection without an explicit upload button. {% tabs %} {% highlight razor %} @using Syncfusion.Blazor.Inputs +@using System.IO + + @code { private async Task OnChange(UploadChangeEventArgs args) { try { - foreach (var file in args.Files) + foreach (var fileEntry in args.Files) { - var path = @"" + file.FileInfo.Name; - FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write); - await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream); - filestream.Close(); + // Define a path where you want to save the file. + // For a Blazor Server app, this path will be on the server. + var uploadsFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads"); + if (!Directory.Exists(uploadsFolder)) + { + Directory.CreateDirectory(uploadsFolder); + } + + // Construct the full file path. + var filePath = Path.Combine(uploadsFolder, fileEntry.FileInfo.Name); + + // Use a FileStream to write the uploaded file's content to the server. + await using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) + { + // OpenReadStream with long.MaxValue allows reading the entire stream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(fileStream); + } + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' saved successfully to '{filePath}'"); } } catch (Exception ex) { - Console.WriteLine(ex.Message); + Console.WriteLine($"Error saving file: {ex.Message}"); } } } @@ -295,20 +318,71 @@ You can get the uploaded files as file stream in the [ValueChange](https://help. {% endhighlight %} {% endtabs %} -![Blazor FileUpload displays Updated Files](./images/blazor-fileupload-with-updated-files.png) +N> When saving files directly in a Blazor Server application using [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) and [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload), the files are saved on the server where the Blazor Server app is running, not on the client's machine. You need appropriate file system permissions for the server process to write to the specified directory. Also, ensure the target directory (`wwwroot/uploads` in this example) exists or is created programmatically. In a production environment, consider secure storage solutions for uploaded files. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDVyZkrqBvaSlvht?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload ValueChange Event](images/blazor-fileupload-valuechange.gif) + -While clicking on the remove icon in the file list, you will get the [OnRemove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnRemove) event with removing file name as argument. So, you can write the remove handler inside OnRemove event to remove the particular file from desired location. Find the remove action code below. +## Memory stream + +When you need to process uploaded files in memory—perhaps for resizing images, reading content, or sending them to another service without saving them to disk first—using a `MemoryStream` is an efficient approach. This is particularly useful for temporary processing or when dealing with sensitive data that shouldn't persist on the file system. + +### Code Example + +This example demonstrates how to read the content of an uploaded file into a [MemoryStream Class](https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream)`. This allows you to perform in-memory operations on the file, such as converting an image to a Base64 string, without requiring disk I/O. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} + +@using Syncfusion.Blazor.Inputs +@using System.IO -Private void onRemove(RemovingEventArgs args) + + + + +@if (!string.IsNullOrEmpty(base64Image)) { - foreach(var removeFile in args.FilesData) +

    Uploaded Image Preview (Base64)

    + +} + +@code { + private string base64Image; + + private async Task OnValueChangeMemoryStream(UploadChangeEventArgs args) { - if (File.Exists(Path.Combine(@"rootPath", removeFile.Name))) + base64Image = string.Empty; // Clear previous image + + foreach (var fileEntry in args.Files) { - File.Delete(Path.Combine(@"rootPath", removeFile.Name)) + if (fileEntry.FileInfo.Type.StartsWith("image/", StringComparison.OrdinalIgnoreCase)) + { + // Create a MemoryStream to hold the file content. + using var memoryStream = new MemoryStream(); + + // Copy the file's content from the upload stream to the MemoryStream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(memoryStream); + + // Convert the MemoryStream content to a byte array. + byte[] imageBytes = memoryStream.ToArray(); + + // Convert byte array to Base64 string for display or further processing. + base64Image = Convert.ToBase64String(imageBytes); + Console.WriteLine($"Image '{fileEntry.FileInfo.Name}' loaded into MemoryStream and converted to Base64."); + } + else + { + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' is not an image and won't be processed for Base64 preview."); + // For non-image files, you could read their content as text or handle differently. + // Example for text file: + // memoryStream.Position = 0; // Reset stream position + // using var reader = new StreamReader(memoryStream); + // var content = await reader.ReadToEndAsync(); + // Console.WriteLine($"Content of {fileEntry.FileInfo.Name}: {content}"); + } } } } @@ -316,108 +390,138 @@ Private void onRemove(RemovingEventArgs args) {% endhighlight %} {% endtabs %} -## With server-side API endpoint +N> When using `MemoryStream` for large files, be mindful of server memory consumption. If you expect very large files, consider processing them in chunks or saving them to temporary storage before processing to avoid out-of-memory exceptions. The `long.MaxValue` in `OpenReadStream` indicates the maximum buffer size. In a Blazor Server app, `Stream` operations occur on the server. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjreNaLUhdwxzvHS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Memory Stream Example](images/blazor-fileupload-memorystream.gif) -The upload process requires save and remove action URL to manage the upload process in the server. -N> * The save action is necessary to handle the upload operation. -
    * The remove action is optional, one can handle the removed files from server. +## Created Event -The save action handler upload the files that needs to be specified in the [SaveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_SaveUrl) property. +The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event fires after the File Upload component has been rendered and initialized. This event is a good place to perform any initial setup, attach custom event listeners to the component's DOM elements, or apply custom styling that requires the component to be fully rendered. -The save handler receives the submitted files and manages the save process in server. After uploading the files to server location, the color of the selected file name changes to green and the remove icon is changed as bin icon. +### Code Example -The remove action is optional. The remove action handler removes the files that needs to be specified in the [RemoveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_RemoveUrl) property. [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnActionComplete) event triggers after all the selected files have been processed to upload successfully or failed to server. +This example shows how to use the [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event to add a custom message or dynamically change some aspect of the uploader's appearance right after it's created. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} -[Route("api/[controller]")] -public class SampleDataController : Controller -{ - public string uploads = ".\\Uploaded Files"; // replace with your directory path +@using Syncfusion.Blazor.Inputs - [HttpPost("[action]")] - public async Task Save(IFormFile UploadFiles) // Save the uploaded file here - { - if (UploadFiles.Length > 0) - { - //Create directory if not exists - if (!Directory.Exists(uploads)) - { - Directory.CreateDirectory(uploads); - } + + + - var filePath = Path.Combine(uploads, UploadFiles.FileName); - if (System.IO.File.Exists(filePath)) - { - //Return conflict status code - return new StatusCodeResult(StatusCodes.Status409Conflict); - } - using (var fileStream = new FileStream(filePath, FileMode.Create)) - { - //Save the uploaded file to server - await UploadFiles.CopyToAsync(fileStream); - } - } - return Ok(); - } +

    @statusMessage

    +@code { + private string statusMessage = "Uploader not yet created."; - [HttpPost("[action]")] - public void Remove(string UploadFiles) // Delete the uploaded file here + private void OnUploaderCreated() { - if(UploadFiles != null) - { - var filePath = Path.Combine(uploads, UploadFiles); - if (System.IO.File.Exists(filePath)) - { - //Delete the file from server - System.IO.File.Delete(filePath); - } - } + statusMessage = "Syncfusion File Uploader has been successfully created and initialized!"; + Console.WriteLine(statusMessage); + // You could also interact with JavaScript to modify DOM here if needed. + // For example: JSRuntime.InvokeVoidAsync("someJsFunction"); } } {% endhighlight %} {% endtabs %} -The [OnFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFailure) event is triggered when there is a failure in the AJAX request during the uploading or removing of files. It provides a way to handle and respond to any errors or issues that occur during the file upload or removal process. +N> The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event is useful for client-side JavaScript interop if you need to manipulate the DOM elements of the uploader component immediately after it's ready. However, for most Blazor-specific customizations (like custom templates), you should use the built-in Blazor features. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLyNuVUBGtPZrdo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Created Example](images/blazor-fileupload-created.gif) + + +## File Selected Event + +The [`FileSelected Event`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected)event is triggered when files are chosen from the file explorer dialog, but **before** the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event. This event provides an opportunity to perform validations on the selected files (e.g., file size, type, count) and decide whether to proceed with the upload/value change or cancel the selection. It's ideal for immediate client-side feedback or preventative actions. + +### Code Example + +This example demonstrates how to use the [FileSelected Event](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected) event to prevent files larger than a certain size. {% tabs %} {% highlight razor %} - - - +@using Syncfusion.Blazor.Inputs +@using System.Linq + + + +

    @validationMessage

    + @code { - private void OnFailureHandler(FailureEventArgs args) - { - // Here, you can customize your code. - } - private void OnActionCompleteHandler(ActionCompleteEventArgs args) + private string validationMessage = ""; + private readonly long MaxFileSize = 1024 * 1024; // 1 MB + + private void OnFileSelected(SelectedEventArgs args) { - // Here, you can customize your code. + validationMessage = ""; + foreach (var file in args.FilesData) + { + if (file.Size > MaxFileSize) + { + validationMessage += $"Error: File '{file.Name}' exceeds {MaxFileSize / (1024 * 1024)} MB limit. "; + args.Cancel = true; // Prevents this file from being added + } + } + if (!string.IsNullOrEmpty(validationMessage)) + { + Console.WriteLine(validationMessage); + } + else + { + Console.WriteLine("Files selected successfully and passed initial validation."); + } } } {% endhighlight %} {% endtabs %} -## Configure allowed file types +N> Setting `args.Cancel = true` in the `FileSelected` event will prevent the file (or files if `args.Files` contains multiple) from being added to the uploader's internal file list. This is a client-side validation and should be complemented with server-side validation for robust security and data integrity. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLIZuBUVwEJoJpz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload File Selected Example](images/blazor-fileupload-fileselected.gif) + + +## OnFileListRender + +The [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) event allows you to customize individual file list items before they are rendered in the uploader's UI. This is highly useful for scenarios where you need to display additional information alongside each file, such as a custom preview, metadata, or actions. -You can allow the specific files alone to upload using the [AllowedExtensions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderModel.html#Syncfusion_Blazor_Inputs_UploaderModel_AllowedExtensions) property. The extension can be represented as collection by comma separators. The uploader component filters the selected or dropped files to match against the specified file types and processes the upload operation. The validation happens when you specify value to inline attribute to accept the original input element. +### Code Example + +This example demonstrates how to use [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) {% tabs %} {% highlight razor %} - +@using Syncfusion.Blazor.Inputs + + + + + + +@code { + SfUploader fileobj; + private void OnFileListRenderHandler(FileListRenderingEventArgs args) + { + + } +} {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhzDsrOqbKVNviI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Allowing Specific Files in Blazor FileUpload](./images/blazor-fileupload-allow-specific-file.png)" %} N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload). @@ -427,4 +531,4 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting- 2. [Getting Started with Syncfusion® Blazor for client-side in Visual Studio](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-visual-studio) 3. [Getting Started with Syncfusion® Blazor for server-side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) 4. [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) - +5. [How to convert images to Base64 string with Blazor File Upload](https://support.syncfusion.com/kb/article/21178/how-to-convert-images-to-base64-string-with-blazor-file-upload) diff --git a/blazor/file-upload/getting-started.md b/blazor/file-upload/getting-started.md index 2a500c5009..4b2ec2aca6 100644 --- a/blazor/file-upload/getting-started.md +++ b/blazor/file-upload/getting-started.md @@ -7,9 +7,9 @@ control: File Upload documentation: ug --- -# Getting Started with Blazor File Upload Component in WASM App +# Getting Started with Blazor File Upload Component -This section briefly explains about how to include [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-file-upload) component in your Blazor WebAssembly App using Visual Studio, Visual Studio Code and .NET CLI. +This section briefly explains how to include the [Blazor File Upload](https://www.syncfusion.com/blazor-components/blazor-file-upload) component in your Blazor WebAssembly App using Visual Studio, Visual Studio Code, and the .NET CLI. {% tabcontents %} @@ -17,15 +17,15 @@ This section briefly explains about how to include [Blazor File Upload](https:// ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor App in Visual Studio -You can create a **Blazor WebAssembly App** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-9.0&pivots=vs) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). For detailed instructions, refer to [this guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app). +You can create a **Blazor WebAssembly App** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-9.0&pivots=vs) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). For detailed instructions, refer to [this guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app). -## Install Syncfusion® Blazor Inputs and Themes NuGet in the App +## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -To add **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). Alternatively, you can utilize the following package manager command to achieve the same. +To add the **Blazor File Upload** 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.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). Alternatively, you can utilize the following package manager command to achieve the same. {% tabs %} {% highlight C# tabtitle="Package Manager" %} @@ -36,7 +36,7 @@ Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} {% endhighlight %} {% endtabs %} -N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. +N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. {% endtabcontent %} @@ -44,11 +44,11 @@ N> Syncfusion® Blazor components are availa ## Prerequisites -* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) +* [System requirements for Blazor components](https://blazor.syncfusion.com/documentation/system-requirements) ## Create a new Blazor App in Visual Studio Code -You can create a **Blazor WebAssembly App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vsc) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). For detailed instructions, refer to [this guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app?tabcontent=visual-studio-code). +You can create a **Blazor WebAssembly App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-7.0&pivots=vsc) or the [Syncfusion® Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). For detailed instructions, refer to [this guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app?tabcontent=visual-studio-code). Alternatively, you can create a WebAssembly application using the following command in the terminal(Ctrl+`). @@ -63,11 +63,11 @@ cd BlazorApp {% endtabs %} -## Install Syncfusion® Blazor Inputs and Themes NuGet in the App +## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -* Press Ctrl+` to open the integrated terminal in Visual Studio Code. -* Ensure you’re in the project root directory where your `.csproj` file is located. -* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. +* Press Ctrl+` to open the integrated terminal in Visual Studio Code. +* Ensure you’re in the project root directory where your `.csproj` file is located. +* Run the following command to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package and ensure all dependencies are installed. {% tabs %} @@ -81,7 +81,7 @@ dotnet restore {% endtabs %} -N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. +N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. {% endtabcontent %} @@ -99,9 +99,9 @@ dotnet --version {% endhighlight %} {% endtabs %} -## Create a Blazor WebAssembly App using .NET CLI +## Create a Blazor WebAssembly project using .NET CLI -Run the `dotnet new blazorwasm` command to create a new Blazor WebAssembly App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). +Run the `dotnet new blazorwasm` command to create a new Blazor WebAssembly application in a command prompt (Windows) or terminal (macOS) or command shell (Linux). {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -112,11 +112,11 @@ cd BlazorApp {% endhighlight %} {% endtabs %} -This command creates new Blazor WebAssembly App and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new) topics for more details. +This command creates new Blazor WebAssembly app project and places it in a new directory called `BlazorApp` inside your current location. See [Create Blazor app topic](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-new) topics for more details. -## Install Syncfusion® Blazor Inputs and Themes NuGet in the App +## Install Syncfusion® Blazor Inputs and Themes NuGet in the App -Here's an example of how to add **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. +Here's an example of how to add the **Blazor File Upload** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Inputs](https://www.nuget.org/packages/Syncfusion.Blazor.Inputs/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details. {% tabs %} {% highlight c# tabtitle=".NET CLI" %} @@ -128,7 +128,7 @@ dotnet restore {% endhighlight %} {% endtabs %} -N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. +N> Syncfusion® Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details. {% endtabcontent %} @@ -147,9 +147,9 @@ Open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncf {% endhighlight %} {% endtabs %} -## Register Syncfusion® Blazor Service +## Register Syncfusion® Blazor Service -Register the Syncfusion® Blazor Service in the **~/Program.cs** file of your Blazor WebAssembly App. +Register the Syncfusion® Blazor Service in the **~/Program.cs** file of your Blazor WebAssembly App. {% tabs %} {% highlight C# tabtitle="~/Program.cs" hl_lines="3 11" %} @@ -171,7 +171,7 @@ await builder.Build().RunAsync(); {% endhighlight %} {% endtabs %} -## Add stylesheet and script resources +## Add Stylesheet and Script Resources The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet and script references in the `` section of the **~/index.html** file. @@ -187,9 +187,22 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A ``` N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in your Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in your Blazor application. -## Add Blazor File Upload component +## Add Syncfusion® Blazor File Upload component -Add the Syncfusion® Blazor File Upload component in the **~/Pages/Index.razor** file. +The Syncfusion Blazor File Upload component allows you to seamlessly integrate file upload functionalities into your Blazor applications. It supports various features like asynchronous and synchronous uploads, file type validation, progress tracking, and custom templates. A common use case is enabling users to upload documents, images, or other files to a server, or process them directly within the client-side application. + +## Simple Code to render a Usable File Upload Component + +The most basic way to render the File Upload component is by adding the `` tag to your `.razor` page. By default, this component provides a clean interface for users to select files locally. + +Add the Syncfusion® Blazor File Upload component in the **~/Components/Pages/Home.razor** file. If an interactivity location as `per page/component`, define a render mode at the top of the `Home.razor` page. + +N> If an Interactivity Location is set to `Global` and the **Render Mode** is set to `Server`, the render mode is configured in the `App.razor` file by default. + +``` +@* desired render mode define here *@ +@rendermode InteractiveServer +``` {% tabs %} {% highlight razor %} @@ -199,41 +212,60 @@ Add the Syncfusion® Blazor File Upload comp {% endhighlight %} {% endtabs %} -* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. +* Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor File Upload component in your default web browser. + +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXBJXsrOqbMEOurR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor FileUpload Component](./images/blazor-fileupload-component.png)" %} +![Blazor File Upload Basic Component](images/blazor-fileupload-basic.gif) -## Without server-side API endpoint +## Use ValueChange Event -You can upload the files and files of folders in the Blazor application without specifying the server-side API end point using [AsyncSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html). +The [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event fires when files are selected or removed from the uploader. This event is crucial for client-side processing of selected files, allowing you to access file details and their content, which is useful for previewing files or handling uploads without a server-side endpoint. -### Save and Remove actions +### Code Example -You can get the uploaded files as file stream in the [ValueChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event argument. Now, you can write the save handler inside ValueChange event to save the files to desired location. Find the save action code below. +This example demonstrates how to use the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event to save uploaded files directly to a local directory when the [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload) property is set to `true`. This is useful for scenarios where you want to process files immediately after selection without an explicit upload button. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} @using Syncfusion.Blazor.Inputs +@using System.IO + + @code { private async Task OnChange(UploadChangeEventArgs args) { try { - foreach (var file in args.Files) + foreach (var fileEntry in args.Files) { - var path = @"" + file.FileInfo.Name; - FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write); - await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream); - filestream.Close(); + // Define a path where you want to save the file. + // For a Blazor Server app, this path will be on the server. + var uploadsFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads"); + if (!Directory.Exists(uploadsFolder)) + { + Directory.CreateDirectory(uploadsFolder); + } + + // Construct the full file path. + var filePath = Path.Combine(uploadsFolder, fileEntry.FileInfo.Name); + + // Use a FileStream to write the uploaded file's content to the server. + await using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) + { + // OpenReadStream with long.MaxValue allows reading the entire stream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(fileStream); + } + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' saved successfully to '{filePath}'"); } } catch (Exception ex) { - Console.WriteLine(ex.Message); + Console.WriteLine($"Error saving file: {ex.Message}"); } } } @@ -241,85 +273,70 @@ You can get the uploaded files as file stream in the [ValueChange](https://help. {% endhighlight %} {% endtabs %} -![Blazor FileUpload displays Updated Files](./images/blazor-fileupload-with-updated-files.png) +N> When saving files directly in a Blazor Server application using [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) and [`AutoUpload`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_AutoUpload), the files are saved on the server where the Blazor Server app is running, not on the client's machine. You need appropriate file system permissions for the server process to write to the specified directory. Also, ensure the target directory (`wwwroot/uploads` in this example) exists or is created programmatically. In a production environment, consider secure storage solutions for uploaded files. -While clicking on the remove icon in the file list, you will get the [OnRemove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnRemove) event with removing file name as argument. So, you can write the remove handler inside OnRemove event to remove the particular file from desired location. Find the remove action code below. +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDVyZkrqBvaSlvht?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -{% tabs %} -{% highlight cshtml %} +![Blazor File Upload ValueChange Event](images/blazor-fileupload-valuechange.gif) -Private void onRemove(RemovingEventArgs args) -{ - foreach(var removeFile in args.FilesData) - { - if (File.Exists(Path.Combine(@"rootPath", removeFile.Name))) - { - File.Delete(Path.Combine(@"rootPath", removeFile.Name)) - } - } -} -{% endhighlight %} -{% endtabs %} +## Memory stream -## With server-side API endpoint +When you need to process uploaded files in memory—perhaps for resizing images, reading content, or sending them to another service without saving them to disk first—using a `MemoryStream` is an efficient approach. This is particularly useful for temporary processing or when dealing with sensitive data that shouldn't persist on the file system. -The upload process requires save and remove action URL to manage the upload process in the server. +### Code Example -N> * The save action is necessary to handle the upload operation. -
    * The remove action is optional, one can handle the removed files from server. +This example demonstrates how to read the content of an uploaded file into a [MemoryStream Class](https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream)`. This allows you to perform in-memory operations on the file, such as converting an image to a Base64 string, without requiring disk I/O. -The save action handler upload the files that needs to be specified in the [SaveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_SaveUrl) property. - -The save handler receives the submitted files and manages the save process in server. After uploading the files to server location, the color of the selected file name changes to green and the remove icon is changed as bin icon. +{% tabs %} +{% highlight razor %} -The remove action is optional. The remove action handler removes the files that needs to be specified in the [RemoveUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderAsyncSettings.html#Syncfusion_Blazor_Inputs_UploaderAsyncSettings_RemoveUrl) property. [OnActionComplete](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnActionComplete) event triggers after all the selected files have been processed to upload successfully or failed to server. +@using Syncfusion.Blazor.Inputs +@using System.IO -{% tabs %} -{% highlight cshtml %} + + + -[Route("api/[controller]")] -public class SampleDataController : Controller +@if (!string.IsNullOrEmpty(base64Image)) { - public string uploads = ".\\Uploaded Files"; // replace with your directory path +

    Uploaded Image Preview (Base64)

    + +} + +@code { + private string base64Image; - [HttpPost("[action]")] - public async Task Save(IFormFile UploadFiles) // Save the uploaded file here + private async Task OnValueChangeMemoryStream(UploadChangeEventArgs args) { - if (UploadFiles.Length > 0) - { - //Create directory if not exists - if (!Directory.Exists(uploads)) - { - Directory.CreateDirectory(uploads); - } + base64Image = string.Empty; // Clear previous image - var filePath = Path.Combine(uploads, UploadFiles.FileName); - if (System.IO.File.Exists(filePath)) - { - //Return conflict status code - return new StatusCodeResult(StatusCodes.Status409Conflict); - } - using (var fileStream = new FileStream(filePath, FileMode.Create)) + foreach (var fileEntry in args.Files) + { + if (fileEntry.FileInfo.Type.StartsWith("image/", StringComparison.OrdinalIgnoreCase)) { - //Save the uploaded file to server - await UploadFiles.CopyToAsync(fileStream); + // Create a MemoryStream to hold the file content. + using var memoryStream = new MemoryStream(); + + // Copy the file's content from the upload stream to the MemoryStream. + await fileEntry.File.OpenReadStream(long.MaxValue).CopyToAsync(memoryStream); + + // Convert the MemoryStream content to a byte array. + byte[] imageBytes = memoryStream.ToArray(); + + // Convert byte array to Base64 string for display or further processing. + base64Image = Convert.ToBase64String(imageBytes); + Console.WriteLine($"Image '{fileEntry.FileInfo.Name}' loaded into MemoryStream and converted to Base64."); } - } - return Ok(); - } - - - [HttpPost("[action]")] - public void Remove(string UploadFiles) // Delete the uploaded file here - { - if(UploadFiles != null) - { - var filePath = Path.Combine(uploads, UploadFiles); - if (System.IO.File.Exists(filePath)) + else { - //Delete the file from server - System.IO.File.Delete(filePath); + Console.WriteLine($"File '{fileEntry.FileInfo.Name}' is not an image and won't be processed for Base64 preview."); + // For non-image files, you could read their content as text or handle differently. + // Example for text file: + // memoryStream.Position = 0; // Reset stream position + // using var reader = new StreamReader(memoryStream); + // var content = await reader.ReadToEndAsync(); + // Console.WriteLine($"Content of {fileEntry.FileInfo.Name}: {content}"); } } } @@ -328,181 +345,146 @@ public class SampleDataController : Controller {% endhighlight %} {% endtabs %} -The [OnFailure](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFailure) event is triggered when there is a failure in the AJAX request during the uploading or removing of files. It provides a way to handle and respond to any errors or issues that occur during the file upload or removal process. +N> When using `MemoryStream` for large files, be mindful of server memory consumption. If you expect very large files, consider processing them in chunks or saving them to temporary storage before processing to avoid out-of-memory exceptions. The `long.MaxValue` in `OpenReadStream` indicates the maximum buffer size. In a Blazor Server app, `Stream` operations occur on the server. -{% tabs %} -{% highlight razor %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjreNaLUhdwxzvHS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - - - - -@code { - private void OnFailureHandler(FailureEventArgs args) - { - // Here, you can customize your code. - } - private void OnActionCompleteHandler(ActionCompleteEventArgs args) - { - // Here, you can customize your code. - } -} +![Blazor File Upload Memory Stream Example](images/blazor-fileupload-memorystream.gif) -{% endhighlight %} -{% endtabs %} - -### Server-side configuration for saving and returning responses -The following example demonstrates the server-side action for saving files on the server and returning responses in JSON, String, and File formats. +## Created Event -{% tabs %} -{% highlight cshtml %} +The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event fires after the File Upload component has been rendered and initialized. This event is a good place to perform any initial setup, attach custom event listeners to the component's DOM elements, or apply custom styling that requires the component to be fully rendered. -[Route("api/[controller]")] +### Code Example -private IHostingEnvironment hostingEnv; +This example shows how to use the [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event to add a custom message or dynamically change some aspect of the uploader's appearance right after it's created. -public SampleDataController(IHostingEnvironment env) -{ - this.hostingEnv = env; -} - -[HttpPost("[action]")] -public IActionResult Save() -{ - // for JSON Data - try - { - // Process uploaded files - var responseData = new - { - Success = true, - Message = "Files uploaded successfully", - // Additional data can be added here - }; +{% tabs %} +{% highlight razor %} - return Ok(responseData); - } - catch (Exception e) - { - var errorResponse = new - { - Success = false, - Message = "File upload failed: " + e.Message - }; +@using Syncfusion.Blazor.Inputs - return BadRequest(errorResponse); - } + + + - // for String Data - try - { - // Process string data - var data = "success"; - // Return the string data - return Content(data); - } - catch (Exception) - { - var data = "failed"; - return Content(data); - } +

    @statusMessage

    - // for File Data - try - { - // Example: Retrieve file path for stream.txt - var filePath = "stream.txt"; // Example file path - - var fullPath = Path.GetFullPath(filePath); +@code { + private string statusMessage = "Uploader not yet created."; - // Return the file - return PhysicalFile(fullPath, "text/plain"); - } - catch (Exception e) + private void OnUploaderCreated() { - return Content("Failed to retrieve file response: " + e.Message, "text/plain"); + statusMessage = "Syncfusion File Uploader has been successfully created and initialized!"; + Console.WriteLine(statusMessage); + // You could also interact with JavaScript to modify DOM here if needed. + // For example: JSRuntime.InvokeVoidAsync("someJsFunction"); } - } {% endhighlight %} {% endtabs %} -### Client-side configuration for saving and returning responses +N> The [`Created`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_Created) event is useful for client-side JavaScript interop if you need to manipulate the DOM elements of the uploader component immediately after it's ready. However, for most Blazor-specific customizations (like custom templates), you should use the built-in Blazor features. -The following example demonstrates the client-side action for saving files on the server and returning responses in JSON, String, and File formats. +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLyNuVUBGtPZrdo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload Created Example](images/blazor-fileupload-created.gif) + + +## File Selected Event + +The [`FileSelected Event`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected)event is triggered when files are chosen from the file explorer dialog, but **before** the [`ValueChange`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_ValueChange) event. This event provides an opportunity to perform validations on the selected files (e.g., file size, type, count) and decide whether to proceed with the upload/value change or cancel the selection. It's ideal for immediate client-side feedback or preventative actions. + +### Code Example + +This example demonstrates how to use the [FileSelected Event](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_FileSelected) event to prevent files larger than a certain size. {% tabs %} -{% highlight cshtml %} +{% highlight razor %} @using Syncfusion.Blazor.Inputs -@using System.Text.Json +@using System.Linq - - - - + + +

    @validationMessage

    @code { + private string validationMessage = ""; + private readonly long MaxFileSize = 1024 * 1024; // 1 MB - private void OnSuccessHandler(SuccessEventArgs args) + private void OnFileSelected(SelectedEventArgs args) { - if (args.Response is not null) // Check if the event argument is not null + validationMessage = ""; + foreach (var file in args.FilesData) { - var responseText = args.Response.ResponseText; - if (!string.IsNullOrWhiteSpace(responseText)) - { - // for JSON and File Datas - using var jsonDoc = JsonDocument.Parse(responseText); - var jsonResponse = jsonDoc.RootElement; - - if (jsonResponse.TryGetProperty("success", out var successProp)) - { - var isSuccess = successProp.GetBoolean(); - - if (isSuccess) - { - // File upload success - var message = jsonResponse.TryGetProperty("message", out var messageProp) ? messageProp.GetString() : "File uploaded successfully"; - - // Additional processing as needed - } - } - - - // for string Data - var message = responseText; - // Additional processing as needed - } + if (file.Size > MaxFileSize) + { + validationMessage += $"Error: File '{file.Name}' exceeds {MaxFileSize / (1024 * 1024)} MB limit. "; + args.Cancel = true; // Prevents this file from being added + } + } + if (!string.IsNullOrEmpty(validationMessage)) + { + Console.WriteLine(validationMessage); + } + else + { + Console.WriteLine("Files selected successfully and passed initial validation."); } } - } {% endhighlight %} {% endtabs %} -## Configure allowed file types +N> Setting `args.Cancel = true` in the `FileSelected` event will prevent the file (or files if `args.Files` contains multiple) from being added to the uploader's internal file list. This is a client-side validation and should be complemented with server-side validation for robust security and data integrity. -You can allow the specific files alone to upload using the [AllowedExtensions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderModel.html#Syncfusion_Blazor_Inputs_UploaderModel_AllowedExtensions) property. The extension can be represented as collection by comma separators. The uploader component filters the selected or dropped files to match against the specified file types and processes the upload operation. The validation happens when you specify value to inline attribute to accept the original input element. +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLIZuBUVwEJoJpz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload File Selected Example](images/blazor-fileupload-fileselected.gif) + + +## OnFileListRender + +The [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) event allows you to customize individual file list items before they are rendered in the uploader's UI. This is highly useful for scenarios where you need to display additional information alongside each file, such as a custom preview, metadata, or actions. + +### Code Example + +This example demonstrates how to use [`OnFileListRender`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderEvents.html#Syncfusion_Blazor_Inputs_UploaderEvents_OnFileListRender) {% tabs %} {% highlight razor %} - +@using Syncfusion.Blazor.Inputs + + + + + + +@code { + SfUploader fileobj; + private void OnFileListRenderHandler(FileListRenderingEventArgs args) + { + + } +} {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhzDsrOqbKVNviI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Allowing Specific Files in Blazor FileUpload](./images/blazor-fileupload-allow-specific-file.png)" %} N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/FileUpload). + ## See also * [Getting Started with Syncfusion® Blazor for Client-Side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app) * [Getting Started with Syncfusion® Blazor for Server-side in Visual Studio](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio) * [Getting Started with Syncfusion® Blazor for Server-Side in .NET Core CLI](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) * [Getting Started with Syncfusion® File Upload in Blazor WebAssembly using Visual Studio](https://blazor.syncfusion.com/documentation/file-upload/how-to/getting-started-with-blazor-webassembly) +* [How to convert images to Base64 string with Blazor File Upload](https://support.syncfusion.com/kb/article/21178/how-to-convert-images-to-base64-string-with-blazor-file-upload) diff --git a/blazor/file-upload/images/AllowMultiple.gif b/blazor/file-upload/images/AllowMultiple.gif new file mode 100644 index 0000000000..103bcb5bca Binary files /dev/null and b/blazor/file-upload/images/AllowMultiple.gif differ diff --git a/blazor/file-upload/images/AllowedExtension.gif b/blazor/file-upload/images/AllowedExtension.gif new file mode 100644 index 0000000000..89e3996ecf Binary files /dev/null and b/blazor/file-upload/images/AllowedExtension.gif differ diff --git a/blazor/file-upload/images/AutoUpload.gif b/blazor/file-upload/images/AutoUpload.gif new file mode 100644 index 0000000000..b5a5a5a44d Binary files /dev/null and b/blazor/file-upload/images/AutoUpload.gif differ diff --git a/blazor/file-upload/images/blazor-file-upload-browser.png b/blazor/file-upload/images/blazor-file-upload-browser.png new file mode 100644 index 0000000000..a294438247 Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-browser.png differ diff --git a/blazor/file-upload/images/blazor-file-upload-container.png b/blazor/file-upload/images/blazor-file-upload-container.png new file mode 100644 index 0000000000..cd52e6a7db Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-container.png differ diff --git a/blazor/file-upload/images/blazor-file-upload-content.png b/blazor/file-upload/images/blazor-file-upload-content.png new file mode 100644 index 0000000000..2eb9452a45 Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-content.png differ diff --git a/blazor/file-upload/images/blazor-file-upload-cssclass.png b/blazor/file-upload/images/blazor-file-upload-cssclass.png new file mode 100644 index 0000000000..1ceabe3c81 Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-cssclass.png differ diff --git a/blazor/file-upload/images/blazor-file-upload-file-list.gif b/blazor/file-upload/images/blazor-file-upload-file-list.gif new file mode 100644 index 0000000000..522d59e56e Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-file-list.gif differ diff --git a/blazor/file-upload/images/blazor-file-upload-progress.gif b/blazor/file-upload/images/blazor-file-upload-progress.gif new file mode 100644 index 0000000000..894bf61fa9 Binary files /dev/null and b/blazor/file-upload/images/blazor-file-upload-progress.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-basic.gif b/blazor/file-upload/images/blazor-fileupload-basic.gif new file mode 100644 index 0000000000..68ffe86d17 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-basic.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-cancelasync.gif b/blazor/file-upload/images/blazor-fileupload-cancelasync.gif new file mode 100644 index 0000000000..9a2be6fb47 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-cancelasync.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-clearallasync.gif b/blazor/file-upload/images/blazor-fileupload-clearallasync.gif new file mode 100644 index 0000000000..4d95090840 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-clearallasync.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-clipboard-paste.gif b/blazor/file-upload/images/blazor-fileupload-clipboard-paste.gif new file mode 100644 index 0000000000..c624727cb2 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-clipboard-paste.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-created.gif b/blazor/file-upload/images/blazor-fileupload-created.gif new file mode 100644 index 0000000000..11759f373a Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-created.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-drag-and-drop-copy.gif b/blazor/file-upload/images/blazor-fileupload-drag-and-drop-copy.gif new file mode 100644 index 0000000000..75af61547c Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-drag-and-drop-copy.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-drop-area-customization.gif b/blazor/file-upload/images/blazor-fileupload-drop-area-customization.gif new file mode 100644 index 0000000000..ce41052662 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-drop-area-customization.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-drop-area-link.gif b/blazor/file-upload/images/blazor-fileupload-drop-area-link.gif new file mode 100644 index 0000000000..a9f67392f5 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-drop-area-link.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-drop-area-move.gif b/blazor/file-upload/images/blazor-fileupload-drop-area-move.gif new file mode 100644 index 0000000000..d06141df70 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-drop-area-move.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-drop-area-none.gif b/blazor/file-upload/images/blazor-fileupload-drop-area-none.gif new file mode 100644 index 0000000000..c477045b95 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-drop-area-none.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-fileselected.gif b/blazor/file-upload/images/blazor-fileupload-fileselected.gif new file mode 100644 index 0000000000..8617f4b867 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-fileselected.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-getfiledetails.gif b/blazor/file-upload/images/blazor-fileupload-getfiledetails.gif new file mode 100644 index 0000000000..ff9364144e Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-getfiledetails.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-getfilesdataasync.gif b/blazor/file-upload/images/blazor-fileupload-getfilesdataasync.gif new file mode 100644 index 0000000000..ff2b997c97 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-getfilesdataasync.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-memorystream.gif b/blazor/file-upload/images/blazor-fileupload-memorystream.gif new file mode 100644 index 0000000000..f2146ef200 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-memorystream.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-removeasync.gif b/blazor/file-upload/images/blazor-fileupload-removeasync.gif new file mode 100644 index 0000000000..889395d97b Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-removeasync.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-uploadasync.gif b/blazor/file-upload/images/blazor-fileupload-uploadasync.gif new file mode 100644 index 0000000000..bf9c7e1ecc Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-uploadasync.gif differ diff --git a/blazor/file-upload/images/blazor-fileupload-valuechange.gif b/blazor/file-upload/images/blazor-fileupload-valuechange.gif new file mode 100644 index 0000000000..afd16653d8 Binary files /dev/null and b/blazor/file-upload/images/blazor-fileupload-valuechange.gif differ diff --git a/blazor/file-upload/localization.md b/blazor/file-upload/localization.md index e7c6883315..bd91e668f1 100644 --- a/blazor/file-upload/localization.md +++ b/blazor/file-upload/localization.md @@ -1,7 +1,7 @@ --- layout: post title: Localization in Blazor File Upload Component | Syncfusion -description: Checkout and learn here all about Localization in Syncfusion Blazor File Upload component and much more. +description: Learn how to translate labels and tooltips in the Syncfusion Blazor File Upload component to different cultures. platform: Blazor control: File Upload documentation: ug @@ -9,4 +9,13 @@ documentation: ug # Localization in Blazor File Upload Component -[Blazor FileUpload](https://www.syncfusion.com/blazor-components/blazor-file-upload) component can be localized. Refer to [Blazor Localization](https://blazor.syncfusion.com/documentation/common/localization) topic to localize Syncfusion® Blazor components. \ No newline at end of file +The Syncfusion Blazor File Upload component can be localized to display static text, such as button labels and tooltips, in different languages. This is achieved by adding a resource file (`.resx`) for each culture and referencing it in your application. + +The following UI elements of the File Upload component can be localized: + +* **Browse button text:** The label for the file selection button. +* **Drop area hint:** The "Or drop files here" message. +* **File status messages:** Text indicating success, failure, or upload progress. +* **Action button tooltips:** Tooltips for buttons like "Clear" and "Upload." + +To learn more about localizing Syncfusion Blazor components, refer to the [Blazor Localization](https://blazor.syncfusion.com/documentation/common/localization) documentation topic. \ No newline at end of file diff --git a/blazor/file-upload/style-appearance.md b/blazor/file-upload/style-appearance.md index 8704c9c106..4bca884a09 100644 --- a/blazor/file-upload/style-appearance.md +++ b/blazor/file-upload/style-appearance.md @@ -1,61 +1,137 @@ --- layout: post -title: Style and appearance in Blazor File Upload Component | Syncfusion -description: Checkout and learn here all about Style and appearance in Syncfusion Blazor File Upload component and more. +title: File Upload Customization in Blazor File Upload Component | Syncfusion +description: Learn how to style the Syncfusion Blazor File Upload component using CSS to customize its container, buttons, file list, content area, and progress bar. platform: Blazor control: File Upload documentation: ug --- -# Style and appearance in Blazor File Upload Component +# File Uploader Customization in Blazor -The following content provides the exact CSS structure that can be used to modify the control's appearance based on the user preference. +The visual appearance of the Syncfusion Blazor File Upload component can be extensively customized using CSS to align with your application's theme and style. This document provides a detailed guide to the component's CSS structure, enabling you to tailor its look and feel. By targeting specific CSS classes, you can modify elements such as the container, buttons, drop area, file list, and progress bar. For best results, it is recommended to use the CssClass property to apply a custom class, which helps scope your styles and prevent them from affecting other components. -## Customizing the appearance of File Upload container element +## CssClass Property -Use the following CSS to customize the appearance of File Upload container element. +The File Upload component allows you to add a custom CSS class to its wrapper element using the [`CssClass`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_CssClass) property. This approach helps scope customizations and prevents unintended global style changes. + +```csharp +@using Syncfusion.Blazor.Inputs + + + + + +@code{ + private void OnChange(UploadChangeEventArgs args) + { + // here you can get uploaded file data + } +} + + +``` + +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVeDkrSTBqHOkfm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload with custom styles applied using CssClass](./images/blazor-file-upload-cssclass.png) + +By using the `e-custom-uploader` class, you can target specific elements within the File Upload component. + +## Customizing the Container + +Customize the main container of the File Upload component to control its overall dimensions and spacing. To scope your changes, target the custom class assigned via the `CssClass` property followed by the component's default class selectors. ```css -/* To specify height */ -.e-upload.e-control-wrapper, .e-bigger.e-small .e-upload.e-control-wrapper { - height: 300px; - width: 300px; +/* To specify a custom height, width and padding */ +.e-upload.e-control-wrapper { + height: 200px; + width: 300px; + padding: 30px; } ``` -## Customizing the File Upload browse button +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhSDuVSpLzhuZgm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload with a customized container size](./images/blazor-file-upload-container.png) -Use the following CSS to customize the File Upload browse button +## Customizing the Browse Button + +Alter the **Browse** button's appearance by targeting the `.e-file-select-wrap .e-btn` selector within your custom class. This allows you to style properties like `background-color`, `color`, and `font-family` to match your application's design. ```css -/* To specify font size and color */ -.e-upload .e-file-select-wrap .e-btn, .e-upload .e-upload-actions .e-btn, .e-bigger.e-small .e-upload .e-file-select-wrap .e-btn, .e-bigger.e-small .e-upload .e-upload-actions .e-btn { - font-family: cursive; - height: 40px; - background-color: aquamarine; - color: coral; +/* To specify font styles, background, and color */ +.e-upload .e-file-select-wrap .e-btn { + font-family: 'cursive'; + height: 40px; + background-color: #ead228; + color: #ca3d09; } ``` -## Customizing the File Upload content +{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVItYBoTrJQsbao?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload with a customized Browse button](./images/blazor-file-upload-browser.png) + +## Customizing the Content Area -Use the following CSS to customize the File Upload content +Style the drop zone where users drag and drop files to provide better visual feedback. Use the `.e-file-drop` selector scoped with your custom class to adjust properties like `font-size` and `color`. ```css /* To specify font size and color */ -.e-upload .e-file-select-wrap .e-file-drop, .e-bigger.e-small .e-upload .e-file-select-wrap .e-file-drop { - font-size: 20px; - color: aqua; +.e-upload .e-file-select-wrap .e-file-drop { + font-size: 20px; + color: aqua; } ``` -## Customizing the uploaded file container in File Upload +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZhetarophoebktx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -Use the following CSS to customize the uploaded file container in File Upload +![Blazor File Upload with a customized content area](./images/blazor-file-upload-content.png) + +## Customizing the File List + +Customize the appearance of the file list that displays selected files. Target the `.e-upload-file-list` selector within your custom class to apply styles like `background-color` to the list container. ```css -/* To specify background color */ +/* To specify a background color */ .e-upload .e-upload-files .e-upload-file-list { - background-color: beige; + background-color: beige; +} +``` + +{% previewsample "https://blazorplayground.syncfusion.com/embed/LjrIjEVIphdshIUl?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload with a customized file list background](./images/blazor-file-upload-file-list.gif) + +## Customizing the Progress Bar + +Provide a consistent look during file uploads by customizing the progress bar and its text. Use the `.e-upload-progress-bar` and `.e-progress-bar-text` selectors, scoped with your custom class, to control properties like `background-color` and `font-weight`. + +```css +/* To specify the background color of the progress bar */ +.e-upload .e-upload-files .e-upload-progress-wrap .e-upload-progress-bar { + background: green; +} + +/* To specify the color of the progress bar text */ +.e-upload .e-upload-files .e-upload-progress-wrap .e-progress-bar-text { + color: #288928; + font-weight: bold; } ``` + +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNVetaVyzLHkRSPG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +![Blazor File Upload with a customized progress bar](./images/blazor-file-upload-progress.gif) + +## See Also + +* [How to create a responsive, full-height file uploader](https://support.syncfusion.com/kb/article/21232/how-to-create-a-responsive-full-height-file-uploader-in-blazor) +* [How to customize button text](https://support.syncfusion.com/kb/article/17457/customizing-button-text-in-blazor-file-upload-component) +* [How to center the Clear and Upload buttons](https://support.syncfusion.com/kb/article/17534/how-to-center-the-clear-and-upload-buttons-in-blazor-file-upload) +* [How to customize the tooltip for the browse button](https://support.syncfusion.com/kb/article/16150/how-to-customize-tooltip-for-browse-button-in-blazor-file-upload) \ No newline at end of file diff --git a/blazor/gantt-chart/images/blazor-gantt-chart-custom-schedule-task.PNG b/blazor/gantt-chart/images/blazor-gantt-chart-custom-schedule-task.PNG deleted file mode 100644 index 9e2da0c3e3..0000000000 Binary files a/blazor/gantt-chart/images/blazor-gantt-chart-custom-schedule-task.PNG and /dev/null differ diff --git a/blazor/getting-started/blazor-single-nuget.md b/blazor/getting-started/blazor-single-nuget.md index ad0a8f38c3..26b91e02b7 100644 --- a/blazor/getting-started/blazor-single-nuget.md +++ b/blazor/getting-started/blazor-single-nuget.md @@ -1,7 +1,7 @@ --- layout: post title: Getting started with Syncfusion.Blazor Single NuGet in Visual Studio -description: Check out the documentation for getting started with Syncfusion.Blazor Single NuGet in Syncfusion Blazor Web App and and explore here to more details. +description: Check out the documentation for getting started with Syncfusion.Blazor Single NuGet in Syncfusion Blazor Application and and explore here to more details. platform: Blazor component: Common documentation: ug @@ -88,9 +88,9 @@ await builder.Build().RunAsync(); The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Reference the stylesheet and script in the `` of the main page as follows: -* For **.NET 8 and .NET 9 WebAssembly Standalone app** , include it in **wwwroot/index.html** file. +* For **.NET 8, .NET 9 and .NET 10 WebAssembly Standalone app** , include it in **wwwroot/index.html** file. -* For **.NET 8 and .NET 9 Blazor WebApp Server Interactive Mode**, include it in **~/Components/App.razor**. +* For **.NET 8, .NET 9 and .NET 10 Blazor WebApp Server Interactive Mode**, include it in **~/Components/App.razor**. ```html diff --git a/blazor/getting-started/blazor-web-app-authentication.md b/blazor/getting-started/blazor-web-app-authentication.md index 0dd8e535a1..958ab8846a 100644 --- a/blazor/getting-started/blazor-web-app-authentication.md +++ b/blazor/getting-started/blazor-web-app-authentication.md @@ -9,7 +9,7 @@ documentation: ug # Getting Started with Blazor Web App with Authentication -This guide demonstrates how to build a **Blazor Web App with authentication** using **.NET 9**. It uses the built-in `AuthenticationStateProvider` to retrieve and manage user identity details from the application's authentication context, enabling secure and consistent user state handling across components. +This guide demonstrates how to build a **Blazor Web App with authentication** using **.NET 9** or **.NET 10**. It uses the built-in `AuthenticationStateProvider` to retrieve and manage user identity details from the application's authentication context, enabling secure and consistent user state handling across components. ## Prerequisites @@ -103,7 +103,7 @@ builder.Services.AddSyncfusionBlazor(); The theme stylesheet and script are available via NuGet as [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). To include them in the application, add the stylesheet reference within the section and the script reference just before the closing tag, as shown below. -* For **.NET 9 and .NET 8** Blazor Web App, include these references in the **~/Components/App.razor** file. +* For **.NET 10, .NET 9 and .NET 8** Blazor Web App, include these references in the **~/Components/App.razor** file. ```html diff --git a/blazor/getting-started/blazor-webassembly-authentication.md b/blazor/getting-started/blazor-webassembly-authentication.md index 1387f4cdca..e5aeb2579e 100644 --- a/blazor/getting-started/blazor-webassembly-authentication.md +++ b/blazor/getting-started/blazor-webassembly-authentication.md @@ -91,7 +91,7 @@ builder.Services.AddSyncfusionBlazor(); The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Reference the stylesheet in the `` section and the script at the end of the `` of the main page as follows: -* For **.NET 9 and .NET 8** Blazor WebAssembly Standalone app, include it in the **~/Components/App.razor** file. +* For **.NET 10, .NET 9 and .NET 8** Blazor WebAssembly Standalone app, include it in the **~/Components/App.razor** file. ```html diff --git a/blazor/getting-started/license-key/how-to-register-in-a-razor-class-library.md b/blazor/getting-started/license-key/how-to-register-in-a-razor-class-library.md index 3e44d19f0e..94796c0cff 100644 --- a/blazor/getting-started/license-key/how-to-register-in-a-razor-class-library.md +++ b/blazor/getting-started/license-key/how-to-register-in-a-razor-class-library.md @@ -45,11 +45,11 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY After referencing the RCL from a Blazor Server application, register the license key in Program.cs. -* For .NET 8 and .NET 9 apps, open **~/Program.cs** and register the Syncfusion license key. +* For .NET 8, .NET 9 and .NET 10 apps, open **~/Program.cs** and register the Syncfusion license key. {% tabs %} -{% highlight c# tabtitle=".NET 8 & .NET 9 (~/Program.cs)" hl_lines="2 3" %} +{% highlight c# tabtitle=".NET 10, .NET 9 & .NET 8 (~/Program.cs)" hl_lines="2 3" %} var app = builder.Build(); // Register the Syncfusion license diff --git a/blazor/getting-started/license-key/how-to-register-in-an-application.md b/blazor/getting-started/license-key/how-to-register-in-an-application.md index d73debec27..03149a3d8b 100644 --- a/blazor/getting-started/license-key/how-to-register-in-an-application.md +++ b/blazor/getting-started/license-key/how-to-register-in-an-application.md @@ -49,11 +49,11 @@ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY ## Blazor Web App (Interactive Server) -* For .NET 8 and .NET 9, open the **~/Program.cs** file and register the Syncfusion® license key. +* For .NET 8, .NET 9 and .NET 10, open the **~/Program.cs** file and register the Syncfusion® license key. {% tabs %} -{% highlight c# tabtitle=".NET 8 & .NET 9 (~/Program.cs)" hl_lines="2 3" %} +{% highlight c# tabtitle=".NET 10, .NET 9 & .NET 8 (~/Program.cs)" hl_lines="2 3" %} var app = builder.Build(); // Register the Syncfusion license @@ -91,7 +91,7 @@ Open **~/Program.cs** file and register the Syncfusion` of the main page as follows: -* For **.NET 8 and .NET 9** Microsoft Teams tab app, include it in the **~/Components/Pages/App.razor** file. +* For **.NET 8, .NET 9 and .NET 10** Microsoft Teams tab app, include it in the **~/Components/Pages/App.razor** file. ```html diff --git a/blazor/getting-started/razor-class-library.md b/blazor/getting-started/razor-class-library.md index e2f5e07cee..9513398628 100644 --- a/blazor/getting-started/razor-class-library.md +++ b/blazor/getting-started/razor-class-library.md @@ -187,7 +187,7 @@ You can create a **Blazor Web App** or **Blazor Server App** or **Blazor WebAsse * For Blazor WebAssembly standalone app, include the stylesheet reference in the `` section and the script reference at the end of the `` in the **~/wwwroot/index.html** file. - * For **.NET 8 and .NET 9** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), include the stylesheet reference in the `` section and the script reference at the end of the `` in the **~/Components/Pages/App.razor** file. + * For **.NET 8, .NET 9 and .NET 10** Blazor Web Apps using any render mode (Server, WebAssembly, or Auto), include the stylesheet reference in the `` section and the script reference at the end of the `` in the **~/Components/Pages/App.razor** file. ```html diff --git a/blazor/image-editor/accessibility.md b/blazor/image-editor/accessibility.md index 3d45a2c370..ae79e36b99 100644 --- a/blazor/image-editor/accessibility.md +++ b/blazor/image-editor/accessibility.md @@ -1,15 +1,15 @@ --- layout: post title: Accessibility in Blazor Image Editor component | Syncfusion -description: Checkout and learn here all about accessibility in Syncfusion Blazor Image Editor component and more. +description: Learn about accessibility support in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor -control: Progress Button +control: Image Editor documentation: ug --- # Accessibility in Blazor Image Editor component -The Blazor Image Editor component followed the accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility. +The Blazor Image Editor component follows accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility. The accessibility compliance for the Blazor Image Editor component is outlined below. @@ -39,25 +39,25 @@ The accessibility compliance for the Blazor Image Editor component is outlined b ## Keyboard interaction -The Blazor Image Editor component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Blazor Image Editor component. +The Blazor Image Editor component follows keyboard interaction guidelines, making it accessible for people who use assistive technologies (AT) and those who rely on keyboard navigation. The following keyboard shortcuts are supported by the Blazor Image Editor component. | Windows | Mac | Actions | | --- | --- | --- | -| Ctrl + Z | + Z | Undo the last user action. | -| Ctrl + Y | + Y | Redo the last user action. | -| Ctrl + S | + S | To save the Image. | -| Ctrl + O | + O | To open the Image. | -| Delete | Delete | To delete the shape once the shape got selected through mouse click . | -| Enter | Enter | To apply Selection Crop or Image Resize. | -| Escape | Escape | To discard operations performed in the Image Editor, such as annotation drawings, crop selection, and more. | +| Ctrl + Z | + Z | Undo the last action. | +| Ctrl + Y | + Y | Redo the last action. | +| Ctrl + S | + S | Save the image. | +| Ctrl + O | + O | Open an image. | +| Delete | Delete | Delete the selected shape. | +| Enter | Enter | Apply selection crop or image resize. | +| Escape | Escape | Discard operations such as annotation drawings and crop selections. | ## Ensuring accessibility -The Blazor Image Editor component's accessibility levels are ensured through an [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) with playwright tests. +The Blazor Image Editor component's accessibility levels are validated using [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) with Playwright tests. -The accessibility compliance of the Blazor Image Editor component is shown in the following sample. Open the [sample](https://blazor.syncfusion.com/accessibility/image-editor) in a new window to evaluate the accessibility of the Blazor Image Editor component with accessibility tools. +The accessibility compliance of the Blazor Image Editor component is demonstrated in the following sample. Open the [sample](https://blazor.syncfusion.com/accessibility/image-editor) in a new window to evaluate the Blazor Image Editor component with accessibility tools. -{% previewsample "https://blazorplayground.syncfusion.com/embed/BtLfZMhEziJhvXKH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXrICNDYqKacaGsS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} ## See also diff --git a/blazor/image-editor/end-user-capabilities.md b/blazor/image-editor/end-user-capabilities.md index 357277c481..567d6e0c30 100644 --- a/blazor/image-editor/end-user-capabilities.md +++ b/blazor/image-editor/end-user-capabilities.md @@ -1,7 +1,7 @@ --- layout: post title: End-user capabilities with Blazor Image Editor Component | Syncfusion -description: Checkout the end-user capabilities available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore end-user capabilities in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,174 +9,177 @@ documentation: ug # End-user capabilities in the Blazor Image Editor component -The following operations are available for end-users and the same is explained briefly in these sections. +The following operations are available for end users and are outlined in the sections below. ## Open an image -To open an image in the image editor, do the following steps. +To open an image in the image editor, follow these steps: -* Click the Open icon from the left side of the toolbar. +* Click the Open icon on the left side of the toolbar. -* The file explorer lists only JPEG, PNG, JPG, WEBP and BMP format files. +* The file explorer lists only JPEG, PNG, JPG, WEBP, and BMP files. -* Select the image from the list of the images from the file explorer window. +* Select an image from the file explorer to load it in the editor. ![Blazor Image Editor with Opening an image showcase](./images/blazor-image-editor-open.gif) ## Zooming -Image zooming can be performed in the following ways. +Image zooming can be performed in the following ways: -* Using toolbar. +* Using the toolbar -* Using pinch zoom in touch enabled devices. +* Using pinch zoom on touch-enabled devices -* Using mouse wheel. +* Using the mouse wheel -* Using keyboard. +* Using the keyboard ![Blazor Image Editor with Zoom In/ Out an image showcase](./images/blazor-image-editor-end-zoom.jpg) ### Using toolbar -To zoom in or out the image in the image editor, do the following steps. +To zoom the image using the toolbar: -* The Zoom In/ Out option only enabled after opening the image. +* Zoom In/Out options are enabled after opening an image. ### Using pinch -To zoom in or out the image in the image editor, do the following steps. +To zoom the image using touch gestures: -* Touch with two fingers to perform zooming. +* Perform a two-finger pinch gesture to zoom in or out. -* Zoom in and out controlled by touch gestures. +* Zoom level is controlled by the pinch distance. ### Using mouse wheel -To zoom in or out the image in the image editor, do the following steps. +To zoom the image using the mouse: -* Press the ctrl key and scroll the mouse wheel to perform zooming. +* Press Ctrl and scroll the mouse wheel to zoom in or out. -* The zoom in and out controlled by the mouse wheel. +* Zoom level is adjusted based on the scroll direction. ### Using keyboard -To zoom in or out the image in the image editor, do the following steps. +To zoom the image using keyboard shortcuts: -* Press the ctrl key with ‘+’ button from the keyboard to zoom in an image. +* Press Ctrl + ‘+’ to zoom in. -* Press the ctrl key with ‘-’ button from the keyboard to zoom out an image. +* Press Ctrl + ‘−’ to zoom out. ## Panning -To pan an image in the image editor, do the following steps. +To pan the image in the editor: -* Click on the image and do dragging to move or pan the image. +* Click and drag on the image to move it within the canvas. -* Panning option will be enabled in the following two cases. +* Panning is enabled in the following cases: - * If the selection is applied for cropping an image. + * When a selection is active for cropping. - * If the image size exceeds the canvas size while zooming an image. + * When the image size exceeds the canvas size due to zooming. ![Blazor Image Editor with Panning an image showcase](./images/blazor-image-editor-pan.gif) ## Cropping and image transformation -To crop an image in the image editor, do the following steps. +To crop and transform an image: -* Cropping can be performed based on the selection in an image editor. +* Cropping is based on a selection within the editor. -* To perform selection, click the crop button in the toolbar which opens the contextual toolbar that shows crop selection options, rotate options, flip options, and straightening options. +* Click the Crop button on the toolbar to open the contextual toolbar with crop selection, rotate, flip, and straighten options. -* Click the crop selection button and select the type of selection such as custom, circle, square, and ratio selection from the popup. +* Click the crop selection button and choose a selection type: custom, circle, square, or ratio. -* Once selection is completed, do panning to move the image to get the cropped region. +* After creating a selection, pan the image to position the desired crop region. -* Utilize the rotate and flip buttons along with the straighten slider to perform image transformations, including any inserted annotations. +* Use rotate and flip buttons and the straighten slider to apply transformations, including to inserted annotations. -* Once the cropping region is finalized in the image click the tick icon at the top right of the toolbar to crop the image. +* When the crop region is finalized, click the tick icon at the top-right of the toolbar to apply the crop. ![Blazor Image Editor with Cropping and Image Transformation showcase](./images/blazor-image-editor-end-crop.jpg) ## Image annotation -To add annotations to an image in the image editor, do the following steps. +To add and modify annotations: -* To add annotation, click the annotation button in the toolbar and select the type of annotations such as Line, Rectangle, Ellipse, Path, Arrow, Text, or Freehand drawing to be inserted to the image editor. +* Click the annotation button on the toolbar and choose an annotation type: Line, Rectangle, Ellipse, Path, Arrow, Text, or Freehand Drawing. -* Once the annotation is added to the image, that can be repositioned by clicking and dragging the annotations using mouse as well as resized by clicking and resizing the selection circle to be placed around the annotations. +* Click and drag on the image to draw the selected annotation. -* To rotate annotations, you can simply grab the circle located at the bottom of the annotation. The rotation can be applicable to all the annotations except text annotation. +* After insertion, annotations can be repositioned by clicking and dragging with the mouse, and resized by interacting with the selection circle placed around the annotation. -* Customize the annotations by changing their color, stroke width, font family, and font size through the contextual toolbar. The contextual toolbar will be enabled whenever the annotations are selected. +* To rotate an annotation, drag the circle at the bottom of the annotation. -* When annotations are selected in the image editor, the quick access toolbar becomes active, providing convenient access to various actions such as duplicating, deleting, or editing text associated with the selected annotation. This toolbar enables users to perform these common operations quickly and efficiently, streamlining their workflow and enhancing the overall editing experience. +* Customize annotations using the contextual toolbar: color, stroke width, font family, and font size. The contextual toolbar appears when an annotation is selected. + +* When annotations are selected, the quick access toolbar enables common actions such as duplicate, delete, and edit text to streamline editing. ![Blazor Image Editor with annotation showcase](./images/blazor-image-editor-end-annotation.jpg) -## Filtering and fine-tune +## Fine-tune -To perform fine-tuning on an image in the image editor, do the following steps. +To apply fine-tuning adjustments: -* Click the fine-tune button which displays the list of fine-tuning available in the image editor. +* Click the Fine-tune button to display available adjustments. -* Click one of the fine-tune options from the list of options which shows a slider to adjust the corresponding filter. +* Choose an adjustment to display a slider for control. -* Click on the canvas or tick icon at the right corner of the toolbar in the image editor to apply the modifications. +* Click on the canvas or the tick icon at the right corner of the toolbar to apply changes. ![Blazor Image Editor with Filtering and finetune showcase](./images/blazor-image-editor-end-finetune.jpg) -To apply filters on an image in the image editor, do the following steps. +## Filter + +To apply filters: -* Click the filter button which displays the list of filters available in the image editor. +* Click the Filter button to display available filters. -* Click the filter from list of options to apply the corresponding filter to an image. +* Select a filter to apply it to the image. -* Click on the canvas or tick icon at the right corner of the toolbar in the image editor to apply the modifications. +* Click on the canvas or the tick icon at the right corner of the toolbar to apply changes. ![Blazor Image Editor with Filtering and finetune showcase](./images/blazor-image-editor-end-filter.jpg) ## Undo and redo the operations -To undo and redo the actions performed in an image editor, do the following steps. +To undo and redo actions in the editor: -* The undo button will be enabled once the action is performed in an image editor. +* The Undo button is enabled after an action is performed. -* The redo button will be enabled once the undo action is performed in an image editor. +* The Redo button is enabled after an undo action is performed. -* Click the undo or redo button at the left side of the toolbar to perform undo and redo operation. +* Click the Undo or Redo button on the left side of the toolbar. -* Ctrl + Z and Ctrl + Y facilitates this process by allowing users to undo and redo actions, respectively. +* Keyboard shortcuts: Ctrl + Z (undo) and Ctrl + Y (redo). ![Blazor Image Editor with Undo and redo showcase](./images/blazor-image-editor-undo-redo.gif) ## Reset an image -To revert all the changes done in an image editor, do the following steps. +To revert all changes in the editor: -* Click the reset button which is located on the right side of the toolbar. +* Click the Reset button on the right side of the toolbar. -* This will revert all the changes performed in the image editor. +* This action reverts all modifications applied in the editor. ## Export an image To save the modified image in the Image Editor, follow these steps: -* Click the Save Button - * Locate the Save button on the right side of the toolbar and click it. +* Click the Save button + * Locate the Save button on the right side of the toolbar and click it. -* Select the File Format - * In the export popup, choose your preferred file format (PNG, JPEG, SVG, or WEBP) to save the image with all -applied modifications. +* Select the file format + * In the export popup, choose the preferred file format (PNG, JPEG, SVG, or WEBP) to save the image with all applied modifications. -* Adjust Image Quality (JPEG Format Only) - * If saving in JPEG, use the Image Quality slider to set the desired quality level (0-100). A higher value retains more detail but increases file size. +* Adjust image quality (JPEG only) + * If saving as JPEG, use predefined settings (Good, Great, Highest) or use the Image Quality slider (0–100). Higher values retain more detail and increase file size. -* Download the Image - * Click Download to save the modified image to your device. +* Download the image + * Click Download to save the modified image. -* Use Keyboard Shortcut (Ctrl + S) - * Press Ctrl + S to download the image in the same format as the loaded image without opening the Save dialog. For example, if the loaded image is PNG, it will be saved as PNG. +* Use keyboard shortcut (Ctrl + S) + * Press Ctrl + S to download the image in the same format as the loaded image without opening the Save dialog. For example, if the loaded image is PNG, it will be saved as PNG. ![Blazor Image Editor with Export an image showcase](./images/blazor-image-editor-end-save.jpg) \ No newline at end of file diff --git a/blazor/image-editor/filter.md b/blazor/image-editor/filter.md index 654ce0e94d..58002d84e5 100644 --- a/blazor/image-editor/filter.md +++ b/blazor/image-editor/filter.md @@ -1,7 +1,7 @@ --- layout: post title: Filter with Blazor Image Editor Component | Syncfusion -description: Checkout the Filter available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore image filter options in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,13 +9,11 @@ documentation: ug # Filters in the Blazor Image Editor component -Filters are pre-defined effects that can be applied to an image to alter its appearance or mood. Image filters can be used to add visual interest or to enhance certain features of the image. Some common types of image filters include cold, warm, chrome, sepia, and invert. +Filters are predefined effects that modify an image’s appearance or mood. They can add visual emphasis or enhance specific elements of an image. Common filters include cold, warm, chrome, sepia, and invert. ## Apply filter effect -The [`ApplyImageFilterAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ApplyImageFilterAsync_Syncfusion_Blazor_ImageEditor_ImageFilterOption_) method is utilized to apply filters to an image. By passing the desired filter type as the first parameter of the method, specified as [`ImageFilterOption`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterOption.html) the method applies the corresponding filter to the image. This allows for easy and convenient application of various filters to enhance or modify the image based on the chosen filter type. - -The `ApplyImageFilterAsync` method is used to perform filtering by specifying the type of filter as `ImageFilterOption` and send it a first parameter of the method. +The [ApplyImageFilterAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ApplyImageFilterAsync_Syncfusion_Blazor_ImageEditor_ImageFilterOption_) method applies a filter to the image. Provide the desired filter as the first parameter using the [ImageFilterOption](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterOption.html) enumeration. Here is an example of filtering using the `ApplyImageFilterAsync` method. @@ -77,14 +75,14 @@ Here is an example of filtering using the `ApplyImageFilterAsync` method. } ``` -![Blazor Image Editor with Filter an image](./images/blazor-image-editor-filter.jpg) +![Blazor Image Editor showing a filter applied to an image](./images/blazor-image-editor-filter.jpg) -### Image filtering event +## Image filtering event -The [`ImageFiltering`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageFiltering) event is triggered when applying filtering on the image. This event is passed an object that contains information about the filtering event, such as the type of filtering. +The [ImageFiltering](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageFiltering) event is triggered when a filter is applied to the image. The event provides details about the action. -The parameter available in the [`ImageFilterEventArgs`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterEventArgs.html) event is, +Parameters available in [ImageFilterEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterEventArgs.html): -ImageFilterEventArgs.Filter - The type of filtering as ImageFilterOption to be applied in the image editor. +- [ImageFilterEventArgs.Filter](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageFilterEventArgs_Filter) - The filter type, as an `ImageFilterOption`, to be applied. -ImageFilterEventArgs.Cancel – Specifies to cancel the filtering action. +- [ImageFilterEventArgs.Cancel](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFilterEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageFilterEventArgs_Cancel) - Indicates whether the filtering action should be canceled. \ No newline at end of file diff --git a/blazor/image-editor/finetune.md b/blazor/image-editor/finetune.md index 77b00542e3..40a55b5698 100644 --- a/blazor/image-editor/finetune.md +++ b/blazor/image-editor/finetune.md @@ -1,7 +1,7 @@ --- layout: post -title: Finetune with Blazor Image Editor Component | Syncfusion -description: Checkout the Finetune available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +title: Fine-tune with Blazor Image Editor Component | Syncfusion +description: Discover the Finetune feature available in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,20 +9,13 @@ documentation: ug # Fine-tune in the Blazor Image Editor component -Fine-tuning involves making precise adjustments to the settings of an image filter in order to achieve a specific desired effect. It provides control over the intensity and specific aspects of the filter's impact on the image. For example, fine-tuning allows you to modify parameters like brightness, saturation, or other relevant properties to fine-tune the level or quality of the filter's effect. This level of control enables you to achieve the exact look or outcome you want for your image. +Fine-tuning provides precise control over image filter settings to achieve a specific visual result. It adjusts the intensity and key attributes of a filter’s effect, such as brightness or saturation, to refine the final output. -## Adjust the brightness, contrast, and saturation +## Adjust brightness, contrast, and saturation -The [`FinetuneImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_FinetuneImageAsync_Syncfusion_Blazor_ImageEditor_ImageFinetuneOption_System_Int32_) method is designed to facilitate fine-tuning operations on an image. It accepts two parameters: the first parameter is [`ImageFinetuneOption`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFinetuneOption.html) which determines the type of fine-tuning to be applied (brightness, contrast, and saturation), and the second parameter represents the fine-tuning value, indicating the degree or intensity of the adjustment. This method allows for convenient adjustment of brightness, contrast, and saturation by specifying the desired type and corresponding value. - -Here is an example of brightness, contrast, and saturation fine-tuning using the `FinetuneImageAsync` method. - -## Adjust the hue, exposure, blur, and opacity - -The [`FinetuneImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_FinetuneImageAsync_Syncfusion_Blazor_ImageEditor_ImageFinetuneOption_System_Int32_) method is designed to facilitate fine-tuning operations on an image. It accepts two parameters: the first parameter is [`ImageFinetuneOption`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFinetuneOption.html) which determines the type of fine-tuning to be applied (hue, exposure, blur, and opacity), and the second parameter represents the fine-tuning value, indicating the degree or intensity of the adjustment. This method allows for convenient adjustment of hue, exposure, blur, and opacity by specifying the desired type and corresponding value. - -Here is an example of hue, exposure, blur, and opacity fine-tuning using the `FinetuneImageAsync` method. +The [FinetuneImageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_FinetuneImageAsync_Syncfusion_Blazor_ImageEditor_ImageFinetuneOption_System_Int32_) method performs fine-tuning on an image. It accepts two parameters: the first is [ImageFinetuneOption](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFinetuneOption.html), which specifies the type of fine-tuning (brightness, contrast, and saturation), and the second is an integer value indicating the degree or intensity of the adjustment. This method enables convenient adjustments to brightness, contrast, and saturation by specifying the desired type and corresponding value. +The following example demonstrates brightness, contrast, and saturation fine-tuning using the `FinetuneImageAsync` method. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -30,12 +23,8 @@ Here is an example of hue, exposure, blur, and opacity fine-tuning using the `Fi
    Brightness - Blur Contrast Contrast - Exposure - Hue - Opacity
    @@ -56,11 +45,6 @@ Here is an example of hue, exposure, blur, and opacity fine-tuning using the `Fi await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Brightness, 10); } - private async void BlurClick() - { - await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Blur, 10); - } - private async void ContrastClick() { await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Contrast, 10); @@ -70,10 +54,39 @@ Here is an example of hue, exposure, blur, and opacity fine-tuning using the `Fi { await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Saturation, 100); } +} +``` - private async void ExposureClick() +![Blazor Image Editor with fine-tuning applied](./images/blazor-image-editor-finetune-saturation.jpg) + +## Adjust hue, exposure, blur, and opacity + +The [FinetuneImageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_FinetuneImageAsync_Syncfusion_Blazor_ImageEditor_ImageFinetuneOption_System_Int32_) method also supports fine-tuning for hue, exposure, blur, and opacity. The first parameter is [ImageFinetuneOption](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageFinetuneOption.html), which specifies the type of fine-tuning to apply (hue, exposure, blur, and opacity), and the second parameter is an integer value representing the intensity of the adjustment. This method allows straightforward adjustment of these properties by specifying the type and value. + +The following example demonstrates hue, exposure, blur, and opacity fine-tuning using the `FinetuneImageAsync` method. + +```cshtml +@using Syncfusion.Blazor.ImageEditor +@using Syncfusion.Blazor.Buttons + +
    + Hue + Exposure + Blur + Opacity +
    + + + + + +@code { + SfImageEditor ImageEditor; + private List customToolbarItem = new List() { }; + + private async void OpenAsync() { - await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Exposure, 10); + await ImageEditor.OpenAsync("https://ej2.syncfusion.com/react/demos/src/image-editor/images/bridge.png"); } private async void HueClick() @@ -81,6 +94,16 @@ Here is an example of hue, exposure, blur, and opacity fine-tuning using the `Fi await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Hue, 10); } + private async void ExposureClick() + { + await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Exposure, 10); + } + + private async void BlurClick() + { + await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Blur, 10); + } + private async void OpacityClick() { await ImageEditor.FinetuneImageAsync(ImageFinetuneOption.Opacity, 70); @@ -88,16 +111,16 @@ Here is an example of hue, exposure, blur, and opacity fine-tuning using the `Fi } ``` -![Blazor Image Editor with Finetune an image](./images/blazor-image-editor-finetune.jpg) +![Blazor Image Editor with fine-tuning applied](./images/blazor-image-editor-finetune-blur.jpg) ## Finetune value changing event -The [`FinetuneValueChanging`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_FinetuneValueChanging) event is triggered when performing fine-tuning on the image. This event is passed an object that contains information about the fine-tuning event, such as the type of fine-tuning and the value of fine-tuning performed. +The [FinetuneValueChanging](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_FinetuneValueChanging) event is triggered during fine-tuning. It provides details such as the fine-tune type and the applied value. -The parameter available in the `FinetuneValueChanging` event is, +Parameters available in [FinetuneEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FinetuneEventArgs.html): -FinetuneEventArgs.Finetune - The type of fine-tuning as ImageFinetuneOption to be applied in the image editor. +- [FinetuneEventArgs.Finetune](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FinetuneEventArgs.html#Syncfusion_Blazor_ImageEditor_FinetuneEventArgs_Finetune) - The type of fine-tuning as `ImageFinetuneOption` to be applied in the image editor. -FinetuneEventArgs.Value - The fine-tuning value to be applied in the image editor. +- [FinetuneEventArgs.Value](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FinetuneEventArgs.html#Syncfusion_Blazor_ImageEditor_FinetuneEventArgs_Value) - The fine-tuning value to be applied in the image editor. -FinetuneEventArgs.Cancel – Specifies a boolean value to cancel the fine-tuning action. +- [FinetuneEventArgs.Cancel](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FinetuneEventArgs.html#Syncfusion_Blazor_ImageEditor_FinetuneEventArgs_Cancel) - A boolean value that cancels the fine-tuning action. \ No newline at end of file diff --git a/blazor/image-editor/frame.md b/blazor/image-editor/frame.md index 044c396dc5..8f3c7c2254 100644 --- a/blazor/image-editor/frame.md +++ b/blazor/image-editor/frame.md @@ -1,7 +1,7 @@ --- layout: post title: Frame with Blazor Image Editor Component | Syncfusion -description: Checkout the Frame available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the Frame feature in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,35 +9,35 @@ documentation: ug # Frames in the Blazor Image Editor component -The frame feature in an Image Editor provides users with the capability to add decorative borders or frames around their images. Frames are a visual design element that can enhance the overall appearance and appeal of an image. +The frame feature in the Image Editor enables adding decorative borders around images. Frames enhance visual appeal and can be styled to match the image context or design requirements. ## Apply frame to the Image -The [`DrawFrameAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DrawFrameAsync_Syncfusion_Blazor_ImageEditor_FrameType_System_String_System_String_System_Int32_System_Int32_System_Int32_System_Int32_Syncfusion_Blazor_ImageEditor_FrameLineStyle_System_Int32_) method is a function designed to enable the application of various frame options to an image. This method simplifies the process of adding decorative frames, such as mat, bevel, line, hook, and inset, to an image by allowing users to specify their desired frame type. +The [DrawFrameAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DrawFrameAsync_Syncfusion_Blazor_ImageEditor_FrameType_System_String_System_String_System_Int32_System_Int32_System_Int32_System_Int32_Syncfusion_Blazor_ImageEditor_FrameLineStyle_System_Int32_) method applies a frame to an image with options such as mat, bevel, line, hook, and inset. -Depending on the frame type selected, users may have additional customization options, such as adjusting the frame's thickness, color, texture, or other attributes. This allows for fine-tuning the appearance of the frame to match the image's theme or the user's preferences +Depending on the selected frame type, additional customization options may be available, such as thickness, color, gradient, and other styling attributes. -The `DrawFrameAsync` method in the Image Editor control takes nine parameters to define the properties of the frame to the image: +The `DrawFrameAsync` method accepts nine parameters that define the frame properties: -* frameType - Specified the image data or url of the image to be inserted. +- `frameType` - Specifies the type of frame to apply. -* color - Specifies the color for the frame. +- `color` - Specifies the frame color. -* gradientColor - Specifies the gradient color for the frame. +- `gradientColor` - Specifies the gradient color for the frame. -* size - Specifies the size of the frame. +- `size` - Specifies the frame size. -* inset - Specifies the inset value for line, hook, and inset type frames. +- `inset` - Specifies the inset value for line, hook, and inset frame types. -* offset - Specifies the offset value for line and inset type frames. +- `offset` - Specifies the offset value for line and inset frame types. -* borderRadius - Specifies the border radius for line type frame. +- `borderRadius` - Specifies the border radius for the line frame type. -* frameLineStyle - Specifies the frame line style for line type frame. +- `frameLineStyle` - Specifies the frame line style for the line frame type. -* lineCount - Specifies the line count for the line type frame. +- `lineCount` - Specifies the line count for the line frame type. -Here is an example of Frame using the `DrawFrameAsync` method. +Here is an example of applying frames using the `DrawFrameAsync` method. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -91,20 +91,20 @@ Here is an example of Frame using the `DrawFrameAsync` method. } ``` -![Blazor Image Editor with Frame an image](./images/blazor-image-editor-frame.png) +![Blazor Image Editor with a frame applied](./images/blazor-image-editor-frame.jpg) ## Frame changing event -The [`FrameChanging`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_FrameChanging) event is triggered when applying frame on the image. This event provides information encapsulated within an object, which includes details about the frame applied in an image. This information encompasses: +The [FrameChanging](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_FrameChanging) event is triggered while applying a frame. The event object provides details about the frame settings involved in the change. -Frame Type: This indicates the specific type of frame being applied, whether it's a mat, bevel, line, or hook. +- Frame type: Specifies the type of frame applied, such as mat, bevel, line, hook, or inset. -Customization Values: These values contain information about any adjustments or modifications made to the frame. For instance, if the frame can be customized with attributes like color, size, or style, these details are conveyed within the event object. +- Customization values: Includes attributes such as color, size, style, inset, offset, gradient color, and related settings. -The parameter available in the [`FrameChangeEventArgs`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html) is +Parameters available in [FrameChangeEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html): -* [`FrameChangeEventArgs.PreviousFrameSetting`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_PreviousFrameSetting) - The frame settings including size, color, inset, offset, gradient color which is applied before changing the frame. +- [FrameChangeEventArgs.PreviousFrameSetting](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_PreviousFrameSetting) - Frame settings (size, color, inset, offset, gradient color) applied before the change. -* [`FrameChangeEventArgs.CurrentFrameSetting`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_CurrentFrameSetting) - The frame settings including size, color, inset, offset, gradient color which is going to apply after changing the frame. +- [FrameChangeEventArgs.CurrentFrameSetting](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_CurrentFrameSetting) - Frame settings (size, color, inset, offset, gradient color) to be applied after the change. -* [`FrameChangeEventArgs.Cancel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_Cancel) - Specifies a boolean value to cancel the frame changing action. \ No newline at end of file +- [FrameChangeEventArgs.Cancel](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.FrameChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_FrameChangeEventArgs_Cancel) - Indicates whether to cancel the frame-changing action. \ No newline at end of file diff --git a/blazor/image-editor/how-to/clear-image.md b/blazor/image-editor/how-to/clear-image.md index 1fe69261e8..bf4a911539 100644 --- a/blazor/image-editor/how-to/clear-image.md +++ b/blazor/image-editor/how-to/clear-image.md @@ -1,7 +1,7 @@ --- layout: post title: Clear an Image with Blazor Image Editor Component | Syncfusion -description: Learn here all about Clear an Image in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Learn how to clear an image in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Clear an Image in the Blazor Image Editor component -The [`ClearImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ClearImageAsync) method in the image editor control is indeed useful for scenarios where you need to ensure that the image editor is emptied before reopening it, especially if the editor is used within a dialog. By using `ClearImageAsync` before closing the dialog, you can ensure that the editor does not retain the previously loaded image when the dialog is reopened. This allows users to start fresh with a new image selection. +The [ClearImageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ClearImageAsync) method clears the current image from the editor. This is useful when the component is rendered in a dialog: calling `ClearImageAsync` before closing the dialog prevents the previously loaded image from persisting when the dialog is reopened, ensuring a fresh state for a new selection. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -37,4 +37,4 @@ The [`ClearImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor. } ``` -![Blazor Image Editor with Resize the custom selection](../images/blazor-image-editor-clear-image.jpg) \ No newline at end of file +![Blazor Image Editor clearing the image](../images/blazor-image-editor-clear-image.jpg) \ No newline at end of file diff --git a/blazor/image-editor/how-to/fit-to-width-and-height.md b/blazor/image-editor/how-to/fit-to-width-and-height.md new file mode 100644 index 0000000000..81fbf597cb --- /dev/null +++ b/blazor/image-editor/how-to/fit-to-width-and-height.md @@ -0,0 +1,76 @@ +--- +layout: post +title: Fit to Width and Height with Blazor Image Editor | Syncfusion +description: Learn how to fit to width and height in the Blazor Image Editor component for Blazor Server and WebAssembly applications. +platform: Blazor +control: Image Editor +documentation: ug +--- + +# Fit Image to Editor Width and Height + +The Image Editor's [ZoomAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ZoomAsync_System_Double_Syncfusion_Blazor_ImageEditor_ImageEditorPoint_) method to fit an image to the editor by width or height. Programmatically increase the zoom level until the image dimension matches the editor container's width or height. + +This example demonstrates scenarios that include buttons for fitting the image to its width (Fit Width) or height (Fit Height). + +```cshtml +@using Syncfusion.Blazor.ImageEditor +@using Syncfusion.Blazor.Buttons + + + +
    + Fit Width + Fit Height +
    +@code { + SfImageEditor ImageEditor; + private async void OpenAsync() + { + await ImageEditor.OpenAsync("https://ej2.syncfusion.com/react/demos/src/image-editor/images/bridge.png"); + } + private async void FitWidth() + { + await ImageEditor.ZoomAsync(1); // Reset zoom to original size before applying Fit Width + ImageDimension Dimension = await ImageEditor.GetImageDimensionAsync(); + double ContainerWidth = Convert.ToDouble(ImageEditor.Width); + if (Dimension is not null) + { + double ImageWidth = Dimension.Width; + double OldWidth = Dimension.Width; + double ZoomFactor = 0.1; + double NewZoom; + NewZoom = 1; + while (ImageWidth < ContainerWidth) + { + NewZoom++; + ImageWidth = OldWidth + (OldWidth * ZoomFactor); + ZoomFactor += 0.1; + } + await ImageEditor.ZoomAsync(NewZoom); + } + } + private async void FitHeight() + { + await ImageEditor.ZoomAsync(1); // Reset zoom to original size before applying Fit Height + ImageDimension Dimension = await ImageEditor.GetImageDimensionAsync(); + double ContainerHeight = Convert.ToDouble(ImageEditor.Height); + if (Dimension is not null) + { + double ImageHeight = Dimension.Height; + double OldHeight = Dimension.Height; + double ZoomFactor = 0.1; + double NewZoom = 1; + while (ImageHeight < ContainerHeight) + { + NewZoom++; + ImageHeight = OldHeight + (OldHeight * ZoomFactor); + ZoomFactor += 0.1; + } + await ImageEditor.ZoomAsync(NewZoom); + } + } +} +``` + +![Blazor Image Editor clearing the image](../images/blazor-image-editor-fit-to-width-and-height.jpg) \ No newline at end of file diff --git a/blazor/image-editor/how-to/reset.md b/blazor/image-editor/how-to/reset.md index d8b385126c..5891d76c55 100644 --- a/blazor/image-editor/how-to/reset.md +++ b/blazor/image-editor/how-to/reset.md @@ -1,7 +1,7 @@ --- layout: post -title: Reset an Image with Blazor Image Editor Component | Syncfusion -description: Learn here all about Reset an image in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +title: Reset an image in the Blazor Image Editor | Syncfusion +description: Learn how to reset an image in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,6 +9,6 @@ documentation: ug # Reset an image in the Blazor Image Editor component -The [`ResetAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ResetAsync) method in the Image Editor control provides the capability to undo all the changes made to an image and revert it back to its original state. This method is particularly useful when multiple adjustments, annotations, or transformations have been applied to an image and you want to start over with the original, unmodified version of the image. +The [ResetAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ResetAsync) method in the Image Editor control provides the capability to undo all changes made to an image and revert it to its original state. This method is particularly useful when multiple adjustments, annotations, or transformations have been applied to an image and a return to the original, unmodified version is required. -By invoking the `ResetAsync` method, any modifications or edits made to the image will be undone, and the image will be restored to its initial state. This allows you to easily discard any changes and begin again with the fresh, unaltered image. \ No newline at end of file +Invoking the `ResetAsync` method discards all modifications and restores the image to its initial state, enabling a clean restart of the editing process. \ No newline at end of file diff --git a/blazor/image-editor/image-restrictions.md b/blazor/image-editor/image-restrictions.md index 37adfee207..efe53d636f 100644 --- a/blazor/image-editor/image-restrictions.md +++ b/blazor/image-editor/image-restrictions.md @@ -1,7 +1,7 @@ --- layout: post title: Image Restrictions with Blazor Image Editor Component | Syncfusion -description: Checkout the Image Restrictions available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore image extension and file size restrictions in the Blazor Image Editor for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,15 +9,15 @@ documentation: ug # Image Restrictions in the Blazor Image Editor component -The Image Editor allows users to specify image extensions, as well as the minimum and maximum image sizes for uploaded or loaded images using the [`ImageEditorUploadSettings`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html) property. End users will receive a clear alert message if an uploaded image does not meet the defined criteria, ensuring a seamless and user-friendly upload experience. +The Image Editor supports restricting image uploads by file extension and by minimum and maximum file size using the [ImageEditorUploadSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html) property. When an uploaded image does not meet the configured criteria, the component displays an alert to guide the end user and maintain a smooth workflow. -`Note:` File restrictions apply when uploading images to the Image Editor, whether through the open method or the built-in uploader. If uploadSettings is not defined in the sample, the Image Editor, by default, allows files with .jpg, .png, .svg, .webp and .bmp extensions, without any file size restrictions. +Note: File restrictions apply when opening images via the open method or the built-in uploader. If upload settings are not defined, the Image Editor allows files with .jpg, .png, .svg, .webp, and .bmp extensions, with no file size restrictions. ## Allowed image extensions -The Image Editor allows users to specify acceptable file extensions for uploaded images using the [`ImageEditorUploadSettings.AllowedExtensions`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_AllowedExtensions) property, ensuring that only supported formats, such as `.jpg`, `.png`, `.svg`, `.webp` and `.bmp` are allowed. This helps maintain compatibility and prevents errors caused by unsupported file types. By default, the Image Editor allows files with .jpg, .png, .svg, .webp, and .bmp extensions. +Configure allowed file extensions for uploaded images using the [ImageEditorUploadSettings.AllowedExtensions](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_AllowedExtensions) property. This ensures that only supported formats—such as .jpg, .png, .svg, .webp, and .bmp—are processed, improving compatibility and preventing errors caused by unsupported file types. By default, the Image Editor allows .jpg, .png, .svg, .webp, and .bmp. -`Note:` To specify allowed extensions in the upload settings, use the format '.png, .svg', listing the permitted file types as a comma-separated string. +Note: Specify allowed extensions as a comma-separated string, for example: '.jpg, .svg'. Here is an example of configuring image restrictions using the `ImageEditorUploadSettings` property. @@ -46,9 +46,9 @@ Here is an example of configuring image restrictions using the `ImageEditorUploa ## Minimum and maximum image size -The Image Editor allows users to specify the minimum and maximum size limits for uploaded image files by using the [ImageEditorUploadSettings.MinFileSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_MinFileSize) and [ImageEditorUploadSettings.MaxFileSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_MaxFileSize) properties. This ensures that images meet specific requirements, maintaining consistency and preventing oversized or undersized files from being processed. +Set minimum and maximum upload size limits using the [ImageEditorUploadSettings.MinFileSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_MinFileSize) and [ImageEditorUploadSettings.MaxFileSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorUploadSettings.html#Syncfusion_Blazor_ImageEditor_ImageEditorUploadSettings_MaxFileSize) properties. These constraints enforce consistent input and prevent oversized or undersized files from being processed. -`Note:` Users can also upload images as base64 strings, in which case file extension validation is bypassed, but file size restrictions still apply. +Note: When images are uploaded as base64 strings, file extension validation is bypassed; file size restrictions still apply. Here is an example of configuring image restrictions using the `ImageEditorUploadSettings` property. diff --git a/blazor/image-editor/images/blazor-image-editor-clear-image.jpg b/blazor/image-editor/images/blazor-image-editor-clear-image.jpg index d3fac69d34..89e0e753a6 100644 Binary files a/blazor/image-editor/images/blazor-image-editor-clear-image.jpg and b/blazor/image-editor/images/blazor-image-editor-clear-image.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-file-size-restrict.jpg b/blazor/image-editor/images/blazor-image-editor-file-size-restrict.jpg index a4c7054275..7f9547315e 100644 Binary files a/blazor/image-editor/images/blazor-image-editor-file-size-restrict.jpg and b/blazor/image-editor/images/blazor-image-editor-file-size-restrict.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-file-type-restrict.jpg b/blazor/image-editor/images/blazor-image-editor-file-type-restrict.jpg index 0551f2a81c..95a1173f43 100644 Binary files a/blazor/image-editor/images/blazor-image-editor-file-type-restrict.jpg and b/blazor/image-editor/images/blazor-image-editor-file-type-restrict.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-filter.jpg b/blazor/image-editor/images/blazor-image-editor-filter.jpg index 95ce80ddd8..c060cc35e4 100644 Binary files a/blazor/image-editor/images/blazor-image-editor-filter.jpg and b/blazor/image-editor/images/blazor-image-editor-filter.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-finetune-blur.jpg b/blazor/image-editor/images/blazor-image-editor-finetune-blur.jpg new file mode 100644 index 0000000000..db32269942 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-finetune-blur.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-finetune-saturation.jpg b/blazor/image-editor/images/blazor-image-editor-finetune-saturation.jpg new file mode 100644 index 0000000000..2c6925dc90 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-finetune-saturation.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-finetune.jpg b/blazor/image-editor/images/blazor-image-editor-finetune.jpg deleted file mode 100644 index 0b43d5c60f..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-finetune.jpg and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-fit-to-width-and-height.jpg b/blazor/image-editor/images/blazor-image-editor-fit-to-width-and-height.jpg new file mode 100644 index 0000000000..dd184694a1 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-fit-to-width-and-height.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-frame.jpg b/blazor/image-editor/images/blazor-image-editor-frame.jpg new file mode 100644 index 0000000000..a3fc817954 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-frame.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-frame.png b/blazor/image-editor/images/blazor-image-editor-frame.png deleted file mode 100644 index 557e1cafa4..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-frame.png and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.jpg b/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.jpg new file mode 100644 index 0000000000..cb227691e9 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.png b/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.png deleted file mode 100644 index 3bccbdb8bc..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-quick-access-toolbar.png and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-redact.jpg b/blazor/image-editor/images/blazor-image-editor-redact.jpg new file mode 100644 index 0000000000..64de0991ec Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-redact.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-redact.png b/blazor/image-editor/images/blazor-image-editor-redact.png deleted file mode 100644 index e2b20c0982..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-redact.png and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-resize.jpg b/blazor/image-editor/images/blazor-image-editor-resize.jpg new file mode 100644 index 0000000000..7ae9df6a9c Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-resize.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-resize.png b/blazor/image-editor/images/blazor-image-editor-resize.png deleted file mode 100644 index cc0ea39490..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-resize.png and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-undo-redo.jpg b/blazor/image-editor/images/blazor-image-editor-undo-redo.jpg new file mode 100644 index 0000000000..315d29b056 Binary files /dev/null and b/blazor/image-editor/images/blazor-image-editor-undo-redo.jpg differ diff --git a/blazor/image-editor/images/blazor-image-editor-undo-redo.png b/blazor/image-editor/images/blazor-image-editor-undo-redo.png deleted file mode 100644 index 61da88b7f6..0000000000 Binary files a/blazor/image-editor/images/blazor-image-editor-undo-redo.png and /dev/null differ diff --git a/blazor/image-editor/images/blazor-image-editor-z-order.jpg b/blazor/image-editor/images/blazor-image-editor-z-order.jpg index dc79249e53..c5942a8d6c 100644 Binary files a/blazor/image-editor/images/blazor-image-editor-z-order.jpg and b/blazor/image-editor/images/blazor-image-editor-z-order.jpg differ diff --git a/blazor/image-editor/localization.md b/blazor/image-editor/localization.md index 32b91c70a1..bad0747e6b 100644 --- a/blazor/image-editor/localization.md +++ b/blazor/image-editor/localization.md @@ -1,15 +1,14 @@ --- layout: post title: Localization with Blazor Image Editor Component | Syncfusion -description: Checkout the Localization available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the localization support available in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug --- - # Localization in the Blazor Image Editor component -[Blazor Image editor](https://www.syncfusion.com/blazor-components/blazor-image-editor) component can be localized. Refer to [Blazor Localization](https://blazor.syncfusion.com/documentation/common/localization) topic to localize Syncfusion® Blazor components. +The [Blazor Image Editor](https://www.syncfusion.com/blazor-components/blazor-image-editor) component supports localization. Refer to the [Blazor localization](https://blazor.syncfusion.com/documentation/common/localization) topic to localize Syncfusion® Blazor components. -N> You can also explore our [Blazor Image editor example](https://blazor.syncfusion.com/demos/image-editor/default-functionalities?theme=bootstrap5) to know how to render and configure the image editor. \ No newline at end of file +N> Explore the [Blazor Image Editor example](https://blazor.syncfusion.com/demos/image-editor/default-functionalities?theme=bootstrap5) to see how to render and configure the Image Editor. \ No newline at end of file diff --git a/blazor/image-editor/quick-access.md b/blazor/image-editor/quick-access.md index 6c5c662e81..4b9773ce5a 100644 --- a/blazor/image-editor/quick-access.md +++ b/blazor/image-editor/quick-access.md @@ -1,41 +1,34 @@ --- layout: post title: Quick Access Toolbar with Blazor Image Editor Component | Syncfusion -description: Checkout the Quick Access Toolbar available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the Quick Access Toolbar in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug --- -# Quick access toolbar in the Blazor Image Editor Component +# Quick Access Toolbar in the Blazor Image Editor Component -The quick access toolbars in the Image Editor play a vital role in facilitating interactions with annotations like Rectangle, Ellipse, Line, Arrow, and Path. These toolbars offer a diverse array of tools and options that can be tailored to match the specific requirements and preferences associated with each annotation type. The toolbar is only displayed when an annotation is selected, ensuring a focused and contextual user experience. +The quick access toolbars in the Image Editor facilitate interactions with annotations such as Rectangle, Ellipse, Line, Arrow, and Path. These toolbars provide a configurable set of tools and options tailored to each annotation type. The toolbar appears only when an annotation is selected, ensuring a focused and contextual editing experience. -The [`ShowQuickAccessToolbar`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ShowQuickAccessToolbar) property controls the visibility of the quick access toolbar. Users have the flexibility to enable or disable this toolbar, add or remove items, and create a personalized set of tools. +The [ShowQuickAccessToolbar](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ShowQuickAccessToolbar) property controls quick access toolbar visibility. The toolbar can be enabled or disabled, items can be added or removed, and a customized toolset can be configured. ## Add a custom toolbar item -The quick access toolbar that appears when inserting annotations in the Blazor Image Editor component is customizable using the [`QuickAccessToolbarOpening`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_QuickAccessToolbarOpening) event. This event is triggered when the quick access toolbar is opened, allowing you to modify its contents. To add additional toolbar items to the quick access toolbar, you can access the ToolbarItems property of the [`QuickAccessToolbarEventArgs`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.QuickAccessToolbarEventArgs.html) object within the event handler. By adding or removing items from the ToolbarItems property based on the Item property, you can customize the options available in the quick access toolbar according to your needs. This gives you the ability to extend the functionality of the quick access toolbar and provide additional tools and options for working with inserted annotations. +The quick access toolbar that appears when inserting annotations in the Blazor Image Editor component is customizable using the [QuickAccessToolbarOpening](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_QuickAccessToolbarOpening) event. This event is triggered when the quick access toolbar opens, allowing modification of its contents. Additional toolbar items can be included by accessing the `ToolbarItems` property of the [QuickAccessToolbarEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.QuickAccessToolbarEventArgs.html) object within the event handler. By adding or removing items from `ToolbarItems` based on the `Item` property, the quick access toolbar options can be customized to match specific requirements for working with inserted annotations. -Here is an example of adding the custom toolbar item to the quick access toolbar. +Here is an example of adding a custom toolbar item to the quick access toolbar. ```cshtml @using Syncfusion.Blazor.ImageEditor @using Syncfusion.Blazor.Navigations - + @code { SfImageEditor ImageEditor; - private List customToolbarItem = new List() - { - new ImageEditorToolbarItemModel { Name = "Annotation" }, - new ImageEditorToolbarItemModel { Name = "Confirm" }, - new ImageEditorToolbarItemModel { Name = "Reset" } - }; - private async void OpenAsync() { await ImageEditor.OpenAsync("https://ej2.syncfusion.com/react/demos/src/image-editor/images/bridge.png"); @@ -48,4 +41,4 @@ Here is an example of adding the custom toolbar item to the quick access toolbar } ``` -![Blazor Image Editor with Quick Access Toolbar](./images/blazor-image-editor-quick-access-toolbar.png) \ No newline at end of file +![Blazor Image Editor with Quick Access Toolbar](./images/blazor-image-editor-quick-access-toolbar.jpg) \ No newline at end of file diff --git a/blazor/image-editor/redact.md b/blazor/image-editor/redact.md index 44004c3334..7533632d49 100644 --- a/blazor/image-editor/redact.md +++ b/blazor/image-editor/redact.md @@ -1,7 +1,7 @@ --- layout: post title: Redact with Blazor Image Editor Component | Syncfusion -description: Checkout the Redact available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the Redact support in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,49 +9,49 @@ documentation: ug # Redact in the Blazor Image Editor component -The redact feature in an Image Editor is a valuable tool that empowers users to conceal sensitive information by applying blur or pixel effects to specific areas of an image. This feature is particularly valuable for protecting privacy and complying with data protection regulations, making it easier to securely share images without compromising sensitive information. +The redact feature conceals sensitive content by applying blur or pixel effects to selected regions of an image. It supports privacy protection and regulatory compliance, enabling secure image sharing without exposing confidential information. ## Apply redact to the image -The Image Editor control includes a [`DrawRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DrawRedactAsync_Syncfusion_Blazor_ImageEditor_RedactType_System_Double_System_Double_System_Double_System_Double_System_Int32_) method, which allows you to draw redaction on an image. This method takes six parameters that define how the redact should be carried out: +The Image Editor control provides the [DrawRedactAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DrawRedactAsync_Syncfusion_Blazor_ImageEditor_RedactType_System_Double_System_Double_System_Double_System_Double_System_Int32_) method to draw a redaction on an image. This method accepts six parameters that define how the redaction is applied: -* redactType: Specifies the type of redaction to be drawn on the image such as blur or pixelate. If not specified, the redaction drawing is initiated with the default blur value. +* redactType: Defines the redaction type to draw on the image, such as blur or pixelate. If not specified, redaction uses the default blur type. -* startX: Specifies x-coordinate of redaction. If not specified, the redaction drawing is initiated with the first parameter. +* startX: Defines the x-coordinate of the redaction. If not specified, redaction starts from the image center. -* startY: Specifies y-coordinate of redaction. If not specified it draws redaction from the center point of the image. +* startY: Defines the y-coordinate of the redaction. If not specified, redaction starts from the image center. -* width: Specifies the width of redaction. The default value is 100. +* width: Defines the redaction width. The default value is 100. -* height: Specifies the height of redaction. The default value is 50. +* height: Defines the redaction height. The default value is 50. -* value: Specifies the blur value for blur-type redaction or the pixel size for pixelate-type redaction. Defaults to 20 since the default redaction is blur. +* value: Defines the blur intensity for blur-type redaction or the pixel size for pixelate-type redaction. The default is 20 because the default redaction type is blur. ## Selecting a redact -The Image Editor control includes a [`SelectRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SelectRedactAsync_System_String_) method, which allows you to select a redaction based on the given redaction id. Use [`GetRedactsAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to get the redaction id which is then passed to perform selection. This method takes one parameter that define how the redact should be carried out: +The Image Editor control provides the [SelectRedactAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SelectRedactAsync_System_String_) method to select a redaction by its identifier. Use the [GetRedactsAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to obtain the redaction identifier and pass it to perform selection. This method accepts one parameter: -* id: Specifies the redact id to select a redact on an image. +* id: Defines the redaction identifier to select a redaction on an image. ## Deleting a redact -The Image Editor control includes a [`DeleteRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DeleteRedactAsync_System_String_) method, which allows you to delete a redaction based on the given redaction id. Use [`GetRedactsAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to get the redaction id which is then passed to perform selection. This method takes one parameter that define how the redact should be carried out: +The Image Editor control provides the [DeleteRedactAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DeleteRedactAsync_System_String_) method to delete a redaction by its identifier. Use the [GetRedactsAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to obtain the redaction identifier and pass it to delete the corresponding redaction. This method accepts one parameter: -* id: Specifies the redact id to delete a redact on an image. +* id: Defines the redaction identifier to delete a redaction on an image. ## Updating a redact -The Image Editor control includes a [`UpdateRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_UpdateRedactAsync_Syncfusion_Blazor_ImageEditor_RedactSettings_System_Boolean_) method, which allows you to update the existing redacts by changing its height, width, blur, and pixel size in the component. Use [`GetRedactsAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to get the redacts which is then passed to change the options of a redacts. This method takes two parameters that define how the redact should be carried out: +The Image Editor control provides the [UpdateRedactAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_UpdateRedactAsync_Syncfusion_Blazor_ImageEditor_RedactSettings_System_Boolean_) method to update existing redactions by modifying height, width, blur intensity, or pixel size. Use the [GetRedactsAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to obtain the redactions and pass them to update the desired options. This method accepts two parameters: -* setting: Specifies the redact settings to be updated for the shape on an image. +* setting: Defines the redact settings to update for the redaction on an image. -* isSelected: Specifies to show the redacts in the selected state. +* isSelected: Defines whether to show the redactions in the selected state. ## Getting redacts -The Image Editor control includes a [`GetRedactsAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method, which allows you to get all the redact details which is drawn on an image editor. +The Image Editor control provides the [GetRedactsAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) method to retrieve all redaction details drawn in the Image Editor. -Here's an example demonstrating how to draw, select, delete, update, and get redacts on an image using the [`DrawRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DrawRedactAsync_System_Nullable_System_Int32__System_Nullable_System_Int32__System_Nullable_System_Boolean__), [`SelectRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SelectRedactAsync_System_String_), [`DeleteRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_DeleteRedactAsync_System_String_), [`UpdateRedactAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_UpdateRedactAsync_Syncfusion_Blazor_ImageEditor_RedactSettings_System_Boolean_) and [`GetRedactsAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_GetRedactsAsync) methods. +The following example demonstrates how to draw, select, delete, update, and get redactions using the `DrawRedactAsync`, `SelectRedactAsync`, `DeleteRedactAsync`, `UpdateRedactAsync` and `GetRedactsAsync` methods. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -77,7 +77,7 @@ Here's an example demonstrating how to draw, select, delete, update, and get red private async void addRedact() { ImageDimension Dimension = await ImageEditor.GetImageDimensionAsync(); - await ImageEditor.DrawRedactAsync(RedactType.Blur, Dimension.X.Value + 100, Dimension.Y.Value + 100, 200, 300); + await ImageEditor.DrawRedactAsync(RedactType.Blur, Dimension.X.Value + 10, Dimension.Y.Value + 10, 200, 300); } private async void updateRedact() { @@ -104,4 +104,4 @@ Here's an example demonstrating how to draw, select, delete, update, and get red } ``` -![Blazor Image Editor with Redaction](./images/blazor-image-editor-redact.png) \ No newline at end of file +![Blazor Image Editor with Redaction](./images/blazor-image-editor-redact.jpg) \ No newline at end of file diff --git a/blazor/image-editor/resize.md b/blazor/image-editor/resize.md index 12775e7c19..03d237bb02 100644 --- a/blazor/image-editor/resize.md +++ b/blazor/image-editor/resize.md @@ -1,7 +1,7 @@ --- layout: post title: Resizing with Blazor Image Editor Component | Syncfusion -description: Checkout the Resizing available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the resizing support in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,22 +9,22 @@ documentation: ug # Resize in the Blazor Image Editor component -The resize feature in an Image Editor is a valuable tool that empowers users to modify the size or dimensions of an image to meet their specific requirements. Whether it's for printing, web display, or any other purpose, this feature allows users to tailor images to their desired specifications. +The resize feature adjusts the size or dimensions of an image to match specific requirements for printing, web display, or other use cases. ## Apply resize to the image -The Image Editor control includes a [`ImageResizeAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ImageResizeAsync_System_Int32_System_Int32_System_Boolean_) method, which allows you to adjust the size of an image. This method takes three parameters that define how the resizing should be carried out: +The Image Editor control provides the [`ImageResizeAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ImageResizeAsync_System_Int32_System_Int32_System_Boolean_) method to change image size. This method accepts three parameters that define the resizing behavior: -* width: Specifies the resizing width of the image. +- width: Sets the target width of the image. -* height: Specifies the resizing height of the image. +- height: Sets the target height of the image. -* isAspectRatio: Specifies a boolean value indicating whether the image should maintain its original aspect ratio during resizing. - * When set to `true`, the image maintains its original aspect ratio. The width is applied as specified, and the height is automatically adjusted to maintain the aspect ratio. - * When set to `false`, the image is resized according to the specified width and height, without maintaining the aspect ratio. - * The default value is `false`. +- isAspectRatio: Indicates whether to preserve the original aspect ratio. + - When `true`, the image maintains its original aspect ratio. The specified width is applied, and the height adjusts automatically. + - When `false`, the image resizes to the specified width and height without preserving the aspect ratio. + - The default value is `false`. -Here is an example of resizing the image using the `ImageResizeAsync` method. +Here is an example of resizing the image using the `ImageResizeAsync` method. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -60,22 +60,22 @@ Here is an example of resizing the image using the `ImageResizeAsync` method. } ``` -![Blazor Image Editor with Resize an image](./images/blazor-image-editor-resize.png) +![Blazor Image Editor with a resized image](./images/blazor-image-editor-resize.jpg) ## Resizing event -The [`ImageResizing`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageResizing) event is triggered when resizing the image. This event provides information encapsulated within an object, which includes details about the previous and current height and width of an image. +The [`ImageResizing`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageEditorEvents.html#Syncfusion_Blazor_ImageEditor_ImageEditorEvents_ImageResizing) event triggers while an image is being resized and provides details about the previous and current dimensions. -The parameter available in ResizeEventArgs is, +Parameters available in [ImageResizeEventArgs](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html): -* [`ImageResizeEventArgs.PreviousWidth`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousWidth) - The width of the image before resizing is performed. +- [`ImageResizeEventArgs.PreviousWidth`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousWidth) – The width of the image before resizing. -* [`ImageResizeEventArgs.PreviousHeight`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousHeight) - The height of the image before resizing is performed. +- [`ImageResizeEventArgs.PreviousHeight`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_PreviousHeight) – The height of the image before resizing. -* [`ImageResizeEventArgs.Width`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Width) - The width of the image after resizing is performed. +- [`ImageResizeEventArgs.Width`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Width) – The width of the image after resizing. -* [`ImageResizeEventArgs.Height`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Height) - The width of the image after resizing is performed. +- [`ImageResizeEventArgs.Height`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Height) – The height of the image after resizing. -* [`ImageResizeEventArgs.IsAspectRatio`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_IsAspectRatio) - The type of resizing performed such as aspect ratio or non-aspect ratio. +- [`ImageResizeEventArgs.IsAspectRatio`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_IsAspectRatio) – Indicates whether the resizing preserved the aspect ratio. -* [`ImageResizeEventArgs.Cancel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Cancel) - Specifies a boolean value to cancel the resizing action. \ No newline at end of file +- [`ImageResizeEventArgs.Cancel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ImageResizeEventArgs.html#Syncfusion_Blazor_ImageEditor_ImageResizeEventArgs_Cancel) – A boolean value that cancels the resizing action when set to true. \ No newline at end of file diff --git a/blazor/image-editor/undo-redo.md b/blazor/image-editor/undo-redo.md index 275543a034..d00b1f8534 100644 --- a/blazor/image-editor/undo-redo.md +++ b/blazor/image-editor/undo-redo.md @@ -1,27 +1,27 @@ --- layout: post -title: Undo Redo with Blazor Image Editor Component | Syncfusion -description: Checkout the Undo Redo available in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +title: Undo and Redo with Blazor Image Editor Component | Syncfusion +description: Explore undo and redo features in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug --- -# Undo Redo in the Blazor Image Editor component +# Undo and redo in the Blazor Image Editor component -The undo and redo functionalities provide a way to reverse and repeat editing actions performed on an image. These features are essential for maintaining control and flexibility during the editing process. +The undo and redo functionalities enable reversing and reapplying editing actions performed on an image. These capabilities are essential for maintaining control and flexibility during the editing process. -In Blazor Image Editor component, the undo and redo history typically have a limited capacity, and the number of steps that can be stored is 16 steps, meaning that the editor keeps track of the most recent 16 actions performed on the image. Once the history reaches its maximum capacity, any new actions beyond the 16th step will result in the removal of the oldest action from the history. +In the Blazor Image Editor component, the undo and redo history has a fixed capacity of 16 steps. The editor tracks the most recent 16 actions performed on the image. When the history reaches its maximum capacity, any new action removes the oldest action from the history. -## Undo the action +## Undo the action -The undo action in an image editor allows users to revert the most recent editing action or a series of actions back to their previous state. When the undo command is triggered, the image editor undoes the last applied modification, effectively restoring the image to its state before the action was performed. The undo action is useful for correcting mistakes, removing unwanted changes, or exploring different editing options without permanently altering the image. +The undo action reverts the most recent editing action or a series of actions to their previous state. When the undo command is triggered, the image editor undoes the last applied modification, restoring the image to its prior state. The undo action is useful for correcting mistakes, removing unwanted changes, or testing different editing options without permanently altering the image. ## Redo the action -The redo action in an image editor allows users to reapply previously undone actions or modifications to the image. When the redo command is triggered, the image editor reapplies the last action that was undone, bringing the image back to the state it was in after the action was initially applied. The redo is useful when users want to repeat an action that was previously undone or restore changes that were temporarily reversed. +The redo action reapplies previously undone actions or modifications to the image. When the redo command is triggered, the image editor reapplies the last action that was undone, returning the image to the state it was in after the action was initially applied. The redo action is useful for repeating an action that was previously undone or restoring changes that were temporarily reversed. -Here is an example of undoing and redoing the action using the [`UndoAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_UndoAsync) and [`RedoAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_RedoAsync) method. +Here is an example of undoing and redoing the action using the [UndoAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_UndoAsync) and [RedoAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_RedoAsync) method. ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -64,4 +64,4 @@ Here is an example of undoing and redoing the action using the [`UndoAsync`](htt } ``` -![Blazor Image Editor with Undo Redo an image](./images/blazor-image-editor-undo-redo.png) +![Blazor Image Editor showing undo and redo actions](./images/blazor-image-editor-undo-redo.jpg) diff --git a/blazor/image-editor/z-order.md b/blazor/image-editor/z-order.md index 5e55aae56f..55db766b69 100644 --- a/blazor/image-editor/z-order.md +++ b/blazor/image-editor/z-order.md @@ -1,7 +1,7 @@ --- layout: post title: Z-order with Blazor Image Editor Component | Syncfusion -description: Checkout the Z-order in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App. +description: Explore the Z-order support in the Blazor Image Editor component for Blazor Server and WebAssembly applications. platform: Blazor control: Image Editor documentation: ug @@ -9,20 +9,16 @@ documentation: ug # Z-order in the Blazor Image Editor Component -We are excited to introduce `z-order` support in the Image Editor. It's a powerful tool that allows users to adjust the positioning of annotations. This feature is particularly useful for designing personalized templates like greeting cards or posters, where managing the layering of multiple annotations is crucial for a polished final product. +The Image Editor supports z-order control to manage the stacking order of annotations. This capability is useful when designing templates such as greeting cards or posters, where arranging multiple annotations in the correct order is essential. -Types of adjustment in the Image Editor `z-order` support. +The following z-order actions are available: -* [Bring forward](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_BringForwardAsync_System_String_) - Switch the selected annotation with the annotation one layer ahead of it. +- [Bring forward](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_BringForwardAsync_System_String_) – Swap the selected annotation with the one directly above it. +- [Send backward](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SendBackwardAsync_System_String_) – Swap the selected annotation with the one directly below it. +- [Bring to front](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_BringToFrontAsync_System_String_) – Move the selected annotation in front of all other annotations. +- [Send to back](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SendToBackAsync_System_String_) – Move the selected annotation behind all other annotations. -* [Sent Backward](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SendBackwardAsync_System_String_) - Switch the selected annotation with the annotation one layer behind it. - -* [Bring to Front](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_BringToFrontAsync_System_String_) - Move the selected annotation to ahead of all other annotations. - -* [Send to Back](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_SendToBackAsync_System_String_) - Move the selected annotation to behind all other annotations. - - -In the following example, you can use the `z-order` support. +The following example demonstrates z-order support: ```cshtml @using Syncfusion.Blazor.ImageEditor @@ -79,4 +75,4 @@ In the following example, you can use the `z-order` support. } ``` -![Blazor Image Editor with Opening an image](./images/blazor-image-editor-z-order.jpg) +![Blazor Image Editor z-order example](./images/blazor-image-editor-z-order.jpg) \ No newline at end of file diff --git a/blazor/listbox/how-to/filter-listbox.md b/blazor/listbox/how-to/filter-listbox.md index 8bafa0b764..ae014254a7 100644 --- a/blazor/listbox/how-to/filter-listbox.md +++ b/blazor/listbox/how-to/filter-listbox.md @@ -51,6 +51,4 @@ This example demonstrates how to filter Syncfusion&re } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LthJMjgtfQYiRtee?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Adding Items in Blazor ListBox](./../images/blazor-listbox-filter.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LthJMjgtfQYiRtee?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Adding Items in Blazor ListBox](./../images/blazor-listbox-filter.png)" %} diff --git a/blazor/media-query/media-query-reusable.md b/blazor/media-query/media-query-reusable.md index 7351605d07..776cbe7f61 100644 --- a/blazor/media-query/media-query-reusable.md +++ b/blazor/media-query/media-query-reusable.md @@ -43,7 +43,7 @@ Define the Media Query component along with layout `Body` property within the `C {% endhighlight %} {% endtabs %} -If you are using .NET 9 or .NET 8, configure the `@rendermode` in the `` section of the **~/Components/App.razor** file, as shown below: +If you are using .NET 10, .NET 9 or .NET 8, configure the `@rendermode` in the `` section of the **~/Components/App.razor** file, as shown below: ```html diff --git a/blazor/menu-bar/data-source-binding-and-custom-menu-items.md b/blazor/menu-bar/data-source-binding-and-custom-menu-items.md index 6075ab1def..d14cef47ad 100644 --- a/blazor/menu-bar/data-source-binding-and-custom-menu-items.md +++ b/blazor/menu-bar/data-source-binding-and-custom-menu-items.md @@ -69,9 +69,7 @@ In the following example, the **id**, **pId**, and **text** columns from self-re ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BjLIsZrssHctKuMX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Data Binding in Blazor MenuBar](./images/blazor-menubar-data-binding.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjLIsZrssHctKuMX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Data Binding in Blazor MenuBar](./images/blazor-menubar-data-binding.png)" %} N> In the above example, `TValue` is specified as `MenuItemModel` because the menu is rendered using the `Items` property. @@ -197,9 +195,7 @@ When using TValue with CustomMenuItem in the [MenuTemplates](https://help.syncfu } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtBeMjBiMnvjKgoI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MenuBar with Self-Referential Data with CustomMenuItem TValue in MenuTemplate](./images/blazor-menubar-self-referential-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtBeMjBiMnvjKgoI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MenuBar with Self-Referential Data with CustomMenuItem TValue in MenuTemplate](./images/blazor-menubar-self-referential-data.png)" %} ## Custom Menu Bar Items @@ -378,6 +374,4 @@ To customize Menu Bar items in your application, set your customized template us ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXryiDLMBRagHDoZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MenuBar with Custom Item](./images/blazor-menubar-custom-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXryiDLMBRagHDoZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MenuBar with Custom Item](./images/blazor-menubar-custom-item.png)" %} diff --git a/blazor/multicolumn-combobox/column.md b/blazor/multicolumn-combobox/column.md index e3a00be15e..d6cfb8cf50 100644 --- a/blazor/multicolumn-combobox/column.md +++ b/blazor/multicolumn-combobox/column.md @@ -40,9 +40,7 @@ The MultiColumn ComboBox supports auto-generating columns, which simplifies the {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/rZVpjYVATVHVEqlS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with Text align](./images/column/blazor_multicolumn_combobox_column-text-align.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rZVpjYVATVHVEqlS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Text align](./images/column/blazor_multicolumn_combobox_column-text-align.gif)" %} ## Setting the column template @@ -82,9 +80,7 @@ To enable the rendering of boolean values as checkboxes, you need to set the `Di {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VNhzXOLgTUyFLZUG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with Check Box](./images/column/blazor_multicolumn_combobox_column-checkbox.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VNhzXOLgTUyFLZUG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Check Box](./images/column/blazor_multicolumn_combobox_column-checkbox.gif)" %} ## Setting custom attributes @@ -104,9 +100,7 @@ The following example demonstrates how to customize the appearance of the Multic {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLpZOLApKBUYqMm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with custom attributes](./images/column/blazor_multicolumn_combobox_column-custom-attributes.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLpZOLApKBUYqMm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with custom attributes](./images/column/blazor_multicolumn_combobox_column-custom-attributes.gif)" %} ## Setting the format diff --git a/blazor/multicolumn-combobox/custom-value.md b/blazor/multicolumn-combobox/custom-value.md index 3c88aac00c..6996523b5e 100644 --- a/blazor/multicolumn-combobox/custom-value.md +++ b/blazor/multicolumn-combobox/custom-value.md @@ -49,6 +49,4 @@ You can include custom values in the MultiColumn ComboBox component. If the ente {% endhighlight razor %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BNrzNaLUIDqNTtMS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with custom value](./images/blazor-multicolumn-custom-value.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNrzNaLUIDqNTtMS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with custom value](./images/blazor-multicolumn-custom-value.gif)" %} \ No newline at end of file diff --git a/blazor/multicolumn-combobox/data-binding.md b/blazor/multicolumn-combobox/data-binding.md index 7600d22b4b..8b31417339 100644 --- a/blazor/multicolumn-combobox/data-binding.md +++ b/blazor/multicolumn-combobox/data-binding.md @@ -23,9 +23,7 @@ The MultiColumn ComboBox loads the data from local data sources through the [Dat {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZBftYVqKvgHmaAA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with local data binding](./images/data-binding/blazor_combobox_local-binding.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZBftYVqKvgHmaAA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with local data binding](./images/data-binding/blazor_combobox_local-binding.png)" %} ## Index value binding @@ -149,9 +147,7 @@ The [OData v4 Adaptor](https://blazor.syncfusion.com/documentation/data/adaptors {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LjVJZkBKUbFJULBC?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with OData v4 Adaptor](./images/data-binding/blazor_combobox_odata-v4-services.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LjVJZkBKUbFJULBC?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with OData v4 Adaptor](./images/data-binding/blazor_combobox_odata-v4-services.png)" %} ### Web API adaptor diff --git a/blazor/multicolumn-combobox/filtering.md b/blazor/multicolumn-combobox/filtering.md index 24d304e8ce..c2b5c1046b 100644 --- a/blazor/multicolumn-combobox/filtering.md +++ b/blazor/multicolumn-combobox/filtering.md @@ -21,9 +21,7 @@ The following code demonstrates the filtering functionality with local data in t {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BjLpXkVggODahmWg?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with local data filtering](./images/filtering/blazor_combobox_local-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjLpXkVggODahmWg?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with local data filtering](./images/filtering/blazor_combobox_local-data.png)" %} ## Remote data @@ -57,9 +55,7 @@ In the following example, `EndsWith` filter type has been mapped to the `FilterT {% endhighlight %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/LNLpjaVqKYrUJqyJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor MultiColumn ComboBox with Filter Type](./images/filtering/blazor_combobox_filter-type.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LNLpjaVqKYrUJqyJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor MultiColumn ComboBox with Filter Type](./images/filtering/blazor_combobox_filter-type.png)" %} @@ -218,6 +193,23 @@ This feature can be enabled separately for the [RichTextEditorFontColor](https:/ {% endhighlight %} {% endtabs %} + + + + + + + + + + + + + + + + + ## Built-in editor content styles By default, the content styles of the Rich Text Editor are not returned while retrieving the HTML value from the editor. So, the styles are not applied when using the HTML value outside the editor. To get the styles from the Rich Text Editor’s content for your application, copy and use the following styles directly in your application. The styles listed are used in the UI elements of the Rich Text Editor. diff --git a/blazor/rich-text-editor/tools/table-manipulation.md b/blazor/rich-text-editor/tools/table-manipulation.md index 80b8de149d..adc2ce8b7e 100644 --- a/blazor/rich-text-editor/tools/table-manipulation.md +++ b/blazor/rich-text-editor/tools/table-manipulation.md @@ -160,6 +160,26 @@ The [TableCommandsArgs.Columns](https://help.syncfusion.com/cr/blazor/Syncfusion ![Blazor RichTextEditor inserting table column](../images/blazor-richtexteditor-insert-table-column.png) +## Table column resizing + +The Rich Text Editor supports resizing of table columns, allowing users to adjust the size of individual columns to better fit their content. To resize a column, hover the pointer near the edge of a table cell until the resize cursor appears. Then, click and drag the cell border to modify the column size as needed. + +This feature provides flexibility in organizing tabular data and ensures that tables remain clear, structured, and easy to read, especially when working with varying content lengths or complex layouts. + +## Nesting tables + +The Rich Text Editor allows users to insert tables within other table cells, enabling the creation of nested tables. This feature is useful for building complex layouts such as structured forms, hierarchical data views, or detailed reports. Users can manually insert a nested table by placing the cursor inside a cell and using the table toolbar option or HTML source editing. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/nesting-table.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with code view](./images/blazor-richtexteditor-nesting-table.png) + ## Quick insert for table rows and columns The Rich Text Editor offers a simple and intuitive way to add rows and columns to your tables without interrupting your workflow. You can expand tables directly from the interface, no need to use toolbar buttons. @@ -170,7 +190,7 @@ The Rich Text Editor offers a simple and intuitive way to add rows and columns t - **What you'll see**: A small dot icon (●) will appear at the **top edge** of the cell. - **How to add**: Hover over the dot to reveal a **plus icon (+)**. Click it to insert a new column to the left. -![Blazor RichTextEditor table column quick insert](../images/table_column_quick_insert.gif) +![Blazor RichTextEditor table column quick insert](./images/table_column_quick_insert.gif) ### Insert rows instantly @@ -178,19 +198,19 @@ The Rich Text Editor offers a simple and intuitive way to add rows and columns t - **What you'll see**: A small dot icon (●) will appear at the **left edge** of the cell. - **How to add**: Hover over the dot to reveal a **plus icon (+)**. Click it to insert a new row above. -![Blazor RichTextEditor table row quick insert](../images/table_row_quick_insert.gif) +![Blazor RichTextEditor table row quick insert](./images/table_row_quick_insert.gif) ## Vertical align The text inside the table can be aligned to the top, middle, or bottom using the [TableToolbarCommand.TableCellVerticalAlign](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.TableToolbarCommand.html#Syncfusion_Blazor_RichTextEditor_TableToolbarCommand_TableCellVerticalAlign) command of the quick toolbar. -![Blazor RichTextEditor changing vertical alignment](../images/blazor-richtexteditor-vertical-alignment.png) +![Blazor RichTextEditor changing vertical alignment](./images/blazor-richtexteditor-vertical-alignment.png) ## Horizontal align The text inside the table can be aligned left, right, or center using the `TableCellHorizontalAlign` command of the quick toolbar. -![Blazor RichTextEditor changing horizontal alignment](../images/blazor-richtexteditor-horizontal-alignment.png) +![Blazor RichTextEditor changing horizontal alignment](./images/blazor-richtexteditor-horizontal-alignment.png) ## Border Styles @@ -202,7 +222,7 @@ By default, it provides `Dashed border` and `Alternate rows`. `Alternate border`: Applies the alternative background to the table. -![Blazor RichTextEditor displaying table styles](../images/blazor-richtexteditor-table-style.png) +![Blazor RichTextEditor displaying table styles](./images/blazor-richtexteditor-table-style.png) ### Custom Styles @@ -216,13 +236,13 @@ The Rich Text Editor provides support to custom styles for tables. If you want t {% endhighlight %} {% endtabs %} -![Blazor RichTextEditor with custom table styles](../images/blazor-richtexteditor-custom-table-styles.png) +![Blazor RichTextEditor with custom table styles](./images/blazor-richtexteditor-custom-table-styles.png) ## Cell color The background color can be set for each table cell through the [TableToolbarCommand.BackgroundColor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.TableToolbarCommand.html#Syncfusion_Blazor_RichTextEditor_TableToolbarCommand_BackgroundColor) command available with the quick toolbar. -![Blazor RichTextEditor changing table background color](../images/blazor-richtexteditor-table-background-color.png) +![Blazor RichTextEditor changing table background color](./images/blazor-richtexteditor-table-background-color.png) ## Copy, cut, and paste table rows and columns diff --git a/blazor/rich-text-editor/tools/text-formatting.md b/blazor/rich-text-editor/tools/text-formatting.md new file mode 100644 index 0000000000..069da4b317 --- /dev/null +++ b/blazor/rich-text-editor/tools/text-formatting.md @@ -0,0 +1,371 @@ +--- +layout: post +title: Text Formatting in Blazor Rich Text Editor Component | Syncfusion +description: Checkout and learn here all about Text Formatting in Syncfusion Blazor Rich Text Editor component and more. +platform: Blazor +control: RichTextEditor +documentation: ug +--- + +# Text Formatting in Blazor Rich Text Editor Component + +## Basic text styling + +The Rich Text Editor's basic styles feature provides essential formatting options, including bold, italic, underline, strikethrough, subscript, superscript, and case changes. These fundamental tools enable users to enhance and customize their text effortlessly. By leveraging these options, users can ensure their content is both visually appealing and well-structured. + +### Available text styles + +The table below lists the available text styles in the Rich Text Editor's toolbar. + +| Name | Icons | Summary | Initialization | +|----------------|---------|---------|------------------------------------------| +| Bold | ![Bold icon](../images/bold.png) | Makes text thicker and darker | toolbarSettings: { items: ['Bold']} | `bold` | +| Italic | ![Italic icon](../images/italic.png) | Slants text to the right | toolbarSettings: { items: ['Italic']} | `italic` | +| Underline | ![Underline icon](../images/under-line.png) | Adds a line beneath the text | toolbarSettings: { items: ['Underline']} | +| StrikeThrough | ![StrikeThrough icon](../images/strikethrough.png) | Applies a line through the text. |toolbarSettings: { items: ['StrikeThrough']}| +| InlineCode |![InlineCode icon](../images/inlineCode.png) | Formats text as inline code | toolbarSettings: { items: ['InlineCode']} | `inline code`| +| SubScript | ![SubScript icon](../images/sub-script.png) | Positions text slightly below the normal line |toolbarSettings: { items: ['SubScript']}| +| SuperScript | ![SuperScript icon](../images/super-script.png) | Positions text slightly above the normal line |toolbarSettings: { items: ['SuperScript’']}| +| LowerCase | ![LowerCase icon](../images/lower-case.png) | Converts text to lowercase |toolbarSettings: { items: ['LowerCase']}| +| UpperCase | ![UpperCase icon](../images/upper-case.png) | Converts text to uppercase |toolbarSettings: { items: ['UpperCase’']}| + +Please refer to the sample below to add these basic text styling options in the Rich Text Editor. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/basic-text-format.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor basic text styles](../images/blazor-richtexteditor-basic-text-format.png) + +## Text alignments + +The Rich Text Editor offers various text alignment options, including left, center, right, and justify. To utilize these alignment options, add the Alignments item to the items property in the toolbarSettings. + +> **Important Note:** Text alignment is applied to the entire block element containing the cursor or selected text, not just to the selected text itself. When you apply an alignment, it affects the whole paragraph or block, even if you've only selected a portion of the text. + +Here are the available alignment options: + +* Align Left: +To left-align your text, place the cursor in the desired paragraph or select any text within it, then click the `Align Left` icon in the toolbar. This will align the entire paragraph with the left margin. + +* Align Center: +To center-align your text, place the cursor in the desired paragraph or select any text within it, then click the `Align Center` icon in the toolbar. This will center the entire paragraph within its container. + +* Align Right: +To right-align your text, place the cursor in the desired paragraph or select any text within it, then click the `Align Right` icon in the toolbar. This will align the entire paragraph with the right margin. + +* Align Justify: +To fully justify your text, place the cursor in the desired paragraph or select any text within it, then click the `Align Justify` icon in the toolbar. This will distribute the entire paragraph evenly across the line, aligning it with both the left and right margins. + +Please refer to the sample and code snippets below to add these alignment options in the Rich Text Editor. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/text-alignment.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor text alignments](../images/blazor-richtexteditor-text-alignment.png) + +## Number and bullet format list + +List formatting in the Rich Text Editor allows users to organize content into structured lists, enhancing readability and visual presentation. The control supports two main types of lists: + +1. Ordered Lists +2. Unordered Lists + +### Ordered lists + +Ordered lists present items in a specific sequence, with each item preceded by a number or letter. The Rich Text Editor provides two ways to create and manage ordered lists: + +#### Using the ordered list tool + +The `OrderedList` toolbar item offers a quick way to create or toggle a numbered list. To use it, select the desired text in the editor and click the `OrderedList` button in the toolbar. If the selected text is not already a numbered list, it will be converted into one. If it's already a numbered list, clicking the button will remove the list formatting. + +#### Number format list tool + +For more detailed control over the numbering style, use the `NumberFormatList` dropdown in the toolbar. Select the desired text in the editor, then choose the preferred format from the `NumberFormatList` dropdown. The selected text will be transformed into a numbered list with the chosen style. + +##### Available numbering styles: + +* `None`: Removes numbering while maintaining list structure and indentation +* `Number`: Uses standard numeric sequencing (1, 2, 3, ...) +* `Lower Roman`: Employs lowercase Roman numerals (i, ii, iii, ...) +* `Lowercase Greek`: Utilizes lowercase Greek letters (α, β, γ, ...) +* `Upper Alpha`: Applies uppercase letters (A, B, C, ...) +* `Lower Alpha`: Uses lowercase letters (a, b, c, ...) +* `Upper Roman`: Employs uppercase Roman numerals (I, II, III, ...) + +You can customize the available number formats using the [NumberFormatList](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorNumberFormatList.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorNumberFormatList) property of the Rich Text Editor. + +The following example demonstrates how to customize the number format lists in the Rich Text Editor: + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/number-format-list.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor number formatlist](../images/blazor-richtexteditor-number-format-list.png) + +### Unordered lists + +Unordered lists present items with visual markers, providing an effective way to list items without implying order or priority. The Rich Text Editor offers two methods for creating and managing unordered lists: + +#### Using the unordered list tool + +The `UnorderedList` toolbar item provides a fast way to create or toggle a bulleted list. To use it, select the desired text in the editor and click the `UnorderedList` button in the toolbar. If the selected text is not already a bulleted list, it will be converted into one. If it's already a bulleted list, clicking the button will remove the list formatting. + +#### Bullet format list tool + +For more control over the bullet style, use the `bulletFormatList` dropdown in the toolbar. Select the desired text in the editor, then choose the preferred format from the `bulletFormatList` dropdown. The selected text will be transformed into a bullet list with the chosen style. + +##### Available bullet styles + +* `None`: Removes bullet points while maintaining list structure and indentation +* `Disc`: Displays solid circular bullets +* `Square`: Uses solid square bullets +* `Circle`: Presents hollow circular bullets + +The following example demonstrates how to customize the bullet format lists in the Rich Text Editor: + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/bullet-format-list.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor bullet formatlist](../images/blazor-richtexteditor-bullet-format-list.png) + +## Nested list creation using Tab key + +In the Rich Text Editor, pressing the `Tab` key while the cursor is inside a list item automatically creates a nested list. This behavior allows users to structure their content hierarchically by indenting list items. Each press of the `Tab` key increases the nesting level, converting the current item into a sub-item of the previous one. + +Please refer to the below video for visual behavior and interaction examples: + +![Rich Text Editor list editing behaviour](../images/list-editing.gif) + +## Increase and decrease indent + +The Rich Text Editor allows you to set indentation for text blocks such as paragraphs, headings, or lists. This feature helps you visually organize and structure your content, making it easier to read and understand. + +The Rich Text Editor allows you to configure two types of indentation tools, `Indent` and `Outdent` tool in the Rich Text Editor toolbar using the [RichTextEditorToolbarSettings.Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Items) property. + +| Options | Description | +|----------------|---------| +| Indent | Increases the indentation | +| Outdent | Decreases the indentation | + +To adjust the text indentation: + +1. Select the desired text or paragraph. +2. Click the Indent or Outdent button in the toolbar. +3. The indentation of the selected text will be modified accordingly. + +To configure the `Indent` and `Outdent` toolbar item, refer to the below code. + +### Indentation in lists + +The Rich Text Editor provides powerful indentation features for both bullet and number format lists, allowing users to create nested lists and adjust list levels easily. + +#### Increasing indent + +To increase the indent of a list item: + +1. Select the list item you want to indent. +2. Click the "Increase Indent" button in the toolbar or press Ctrl + ]. +3. The selected item will be indented, creating a nested list. + +#### Decreasing indent + +To decrease the indent of a list item: + +1. Select the indented list item. +2. Click the "Decrease Indent" button in the toolbar or press Ctrl + [. +3. The selected item will move back to the previous indentation level. + +#### Using tab key for indentation + +The Tab key provides a quick way to adjust list indentation: + +- Pressing Tab will increase the indent of the selected list item, creating a nested list. +- Pressing Shift + Tab will decrease the indent of the selected list item, moving it to the previous level. + +This behavior allows for efficient creation and management of multi-level lists without the need to use the toolbar buttons. + +## Heading formats + +The Rich Text Editor provides a feature to format text with various heading styles, such as Heading 1, Heading 2, Heading 3, and Heading 4. These headings allow for structuring content hierarchically, improving readability, and organizing information effectively. + +### Built-in formats + +The following table list the default format name and width of the [Format](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorFormat.html#properties) dropdown and the available list of format names. + +| Default Key | Default Value | +|-----|--------------------------------------| +| [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorFormat.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorFormat_Width) | 65px| +| [Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorFormat.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorFormat_Items) | new List<DropDownItemModel>()
    {
        new DropDownItemModel() { Text = "Paragraph", Value = "P" },
        new DropDownItemModel() { Text = "Code", Value = "Pre" },
        new DropDownItemModel() { Text = "Quotation", Value = "BlockQuote" },
        new DropDownItemModel() { Text = "Heading 1", Value = "H1" },
        new DropDownItemModel() { Text = "Heading 2", Value = "H2" },
        new DropDownItemModel() { Text = "Heading 3", Value = "H3" },
        new DropDownItemModel() { Text = "Heading 4", Value = "H4" }
    }; | + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/built-in-formats.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with built-in format](../images/blazor-richtexteditor-buildin-format.png) + +### Custom format + +The Rich Text Editor provides support for custom formats with an existing list. If you want to add additional formats to the format drop-down, pass the format information as `List` data to the [RichTextEditorFormat.Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorFormat.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorFormat_Items) property. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/custom-formats.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Custom Format](../images/blazor-richtexteditor-custom-format.png) + +## Quotation formatting + +The Rich Text Editor facilitates quotation formatting through the `Blockquote` tool available in the toolbar. Blockquotes are designed to visually highlight significant text, emphasizing key information or quotations by setting them apart from the main content for added emphasis and clarity. + +To format text as a quotation, select the desired text and click on the `Blockquote` icon in the toolbar. The selected text will be formatted as a blockquote, typically indented and styled differently from the surrounding content. + +Use the `Blockquote` tool in the editor below to see the feature in action. + +> In a markdown editor, blockquotes are represented using the `>` symbol. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/quotation-formatting.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Custom Format](../images/blazor-richtexteditor-quotation-formatting.png) + +### Nested blockquotes + +The Rich Text Editor also supports nested blockquotes, allowing one blockquote to be placed inside another. + +While the toolbar does not provide a direct method to apply blockquote formatting recursively (i.e., within an already blockquote section), nested blockquotes can still be achieved in the following ways: + +1. **Pasting preformatted content:** If you paste content that already contains nested blockquote tags (e.g., from another editor or email), the Rich Text Editor will preserve and render the nested structure correctly. +2. **Pre-loading nested blockquote HTML:** You can initialize the editor with nested blockquote content using the value property. +3. **Manual editing via Source Code view:** You can manually insert nested blockquote tags using the SourceCode toolbar option. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/nested-quotation-formatting.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Custom Format](../images/blazor-richtexteditor-nested-quotation-formatting.png) + +## Horizontal line + +The Rich Text Editor enables users to insert horizontal dividers using the `HorizontalLine` tool available in the toolbar. Horizontal lines (
    ) help visually separate sections of content, enhancing readability and structural clarity. + +To insert a horizontal line, place the cursor at the desired location and click the `HorizontalLine` icon in the toolbar. A full-width line will be added, creating a clear visual break between sections of text or other elements. + +Use the `HorizontalLine` tool in the editor below to see the feature in action. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/horizontal-line.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Custom Format](../images/blazor-richtexteditor-horizontal-line.png) + +# Format Painter in Blazor Rich Text Editor + +The format painter tool enables users to replicate formatting from one text segment and apply it to another. It can be accessed through the toolbar or via keyboard shortcuts, allowing the transfer of styles from individual words to entire paragraphs. Customization options are available through the Rich Text Editor[FormatPainterSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorFormatPainterSettings.html) property. + +### Configuring format painter tool in the toolbar + +You can add the `FormatPainter` tool in the Rich Text Editor using the [RichTextEditorToolbarSettings.Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Items) property. + +Double-clicking the Format Painter toolbar button enables **sticky mode**, allowing multiple formatting applications until the `Escape` key is pressed. In sticky mode, the format painter remains active until the `Escape` key is pressed again to disable it. + +The following example demonstrates how to add the Format Painter tool to the Rich Text Editor toolbar. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/format-painter.razor %} + +{% endhighlight %} +{% endtabs %} + +## Clear formatting + +The Rich Text Editor component offers a powerful `Clear Format` feature to remove any applied formatting from selected text. + +This feature is particularly useful when you need to: + +- Remove multiple styles at once +- Quickly standardize text formatting +- Prepare text for new styling + +### Configuring clear format + +The Clear Format feature allows users to remove all formatting (like bold, italic, font styles, etc.) from selected text in the Rich Text Editor. To enable this feature, you need to include it in the toolbar configuration. + +Steps to Configure: + +- Open the component file where the Rich Text Editor is implemented. +- Locate the [RichTextEditorToolbarSettings.Items](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorToolbarSettings.html#Syncfusion_Blazor_RichTextEditor_RichTextEditorToolbarSettings_Items) property in your editor configuration. +- Add `ClearFormat` to the `Items` array within the `ToolbarSettings`. + +Here's an example of how to configure the Clear Format feature: + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/clear-format.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Clear Format](../images/blazor-richtexteditor-clear-format.png) + +### Using clear format + +Once configured, you can use the Clear Format feature as follows: + +1. Select the text with formatting you want to remove. +2. Click the `Clear Format` button in the toolbar. +3. The selected text will revert to its original, unformatted state. + +Using `Clear Format` makes it easy to undo styling changes and keep your text looking consistent. Examples and code snippets below show how to use 'Clear Format' effectively in the Rich Text Editor. + +{% tabs %} +{% highlight razor %} + +{% include_relative code-snippet/using-clear-format.razor %} + +{% endhighlight %} +{% endtabs %} + +![Blazor RichTextEditor with Clear Format](../images/blazor-richtexteditor-using-clear-format.gif) \ No newline at end of file diff --git a/blazor/smart-ai-solutions/ai-samples/kanban/sentiment-analysis.md b/blazor/smart-ai-solutions/ai-samples/kanban/sentiment-analysis.md index d66c1982d1..4f81c9e8e4 100644 --- a/blazor/smart-ai-solutions/ai-samples/kanban/sentiment-analysis.md +++ b/blazor/smart-ai-solutions/ai-samples/kanban/sentiment-analysis.md @@ -30,7 +30,7 @@ Ensure the following NuGet packages are installed based on your chosen AI servic - **OllamaSharp** {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Syncfusion.Blazor.Kanban -Version {{ site.releaseversion }} Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} @@ -48,7 +48,7 @@ Install-Package OllamaSharp # For Ollama Include the theme stylesheet and script from NuGet via [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets) in the `` of your main page: - For **.NET 6** Blazor Server apps, add to **~/Pages/_Layout.cshtml**. -- For **.NET 8 or .NET 9** Blazor Server apps, add to **~/Components/App.razor**. +- For **.NET 8 or .NET 9 or .NET 10** Blazor Server apps, add to **~/Components/App.razor**. ```html @@ -77,7 +77,7 @@ Generate an API key from OpenAI and set `openAIApiKey`. Specify the desired mode - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -88,7 +88,7 @@ Install-Package Microsoft.Extensions.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -115,7 +115,7 @@ Deploy an Azure OpenAI Service resource and model as described in [Microsoft's d - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -127,7 +127,7 @@ Install-Package Azure.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Azure.AI.OpenAI; @@ -163,7 +163,7 @@ To use Ollama for self-hosted AI models: - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package OllamaSharp @@ -174,7 +174,7 @@ Install-Package OllamaSharp - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -202,7 +202,7 @@ Add the Syncfusion Blazor service to your **~/Program.cs** file. The configurati - **WebAssembly or Auto Mode**: Register the service in both the server-side **~/Program.cs** and client-side **~/Program.cs** files. {% tabs %} -{% highlight C# tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} +{% highlight csharp tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} using Syncfusion.Blazor; @@ -216,7 +216,7 @@ builder.Services.AddSyncfusionBlazor(); var app = builder.Build(); {% endhighlight %} -{% highlight C# tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} +{% highlight csharp tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} using Syncfusion.Blazor; @@ -228,304 +228,233 @@ await builder.Build().RunAsync(); {% endhighlight %} {% endtabs %} -## Razor Component +## AI-powered Sentiment Analysis in Kanban -This section demonstrates how to implement sentiment analysis in the Syncfusion Blazor Kanban component using AI. The AI Assistant evaluates the emotional tone of each task description and displays a corresponding emoji (😊, 😐, 😞) to help teams quickly assess the mood or urgency of tasks. This can be especially useful in agile workflows where emotional context can influence task priority and team communication. +The AI-powered sentiment analysis feature in Blazor Kanban evaluates customer feedback for delivered tasks and displays emojis (😊, 😐, 😞) to indicate positive, neutral, or negative sentiment. This helps teams quickly assess satisfaction levels and prioritize follow-up actions, improving customer experience in service workflows. -(`Home.razor`) +### UI Structure -```csharp -@using Syncfusion.Blazor.Kanban -@using Syncfusion.Blazor.SplitButtons -@using Syncfusion.Blazor.Calendars -@using Syncfusion.Blazor.Inputs -@using Syncfusion.Blazor.DropDowns -@using AISamples.Components.Models -@using AISamples.Components.Service -@inject AzureAIService OpenAIService - -
    - - - -
    -
    -
    - - - @foreach (ColumnModel item in columnData) - { - - } - - - + + -``` +{% endhighlight %} +{% endtabs %} -`Home.razor.cs` +### Analyzing Sentiments with AI -```csharp +After the user clicks **Check Customer Sentiments** button, the `GetScore()` method runs. It serializes the Kanban data into JSON and builds a prompt for the AI service using the `GetCompletionAsync` method. The prompt instructs the AI to: + +- Provide a `SentimentScore` out of 5 based on the feedback. +- Skip scoring if feedback is null. +- Return the updated data strictly in JSON format with all fields included. -using System.Text.Json; -using AISamples.Components.Models; -using Syncfusion.Blazor.DropDowns; -using Syncfusion.Blazor.Inputs; -using Syncfusion.Blazor.Kanban; +The AI response is cleaned to remove extra formatting and deserialized into a list of PizzaDataModel objects. Each item’s `SentimentScore` is mapped to an emoji: -namespace AISamples.Components.Pages +- Score > 3 → 😊 smiling face +- Score = 3 → 😐 neutral face +- Score ≤ 2 → 😞 disappointed face + +Finally, `ShowScore` is set to `true`, and the Kanban board updates to display emojis for delivered items. + +```csharp +private async Task GetScore() { - public partial class Home + this.IsSpinner = true; + string result = ""; + string json = JsonSerializer.Serialize(Pizza, new JsonSerializerOptions { WriteIndented = true }); + var description = "Provide a SentimentScore out of 5 (whole numbers only) based on the Feedback. If the feedback is null, do not give a SentimentScore. Use the dataset provided below to make recommendations. NOTE: Return the data in JSON format with all fields included, and return only JSON data, no explanatory text." + json; + result = await OpenAIService.GetCompletionAsync(description); + string data = result.Replace("```json", "").Replace("```", "").Replace("\r", "").Replace("\n", "").Replace("\t", "").Trim(); + this.Pizza = JsonSerializer.Deserialize>(data); + this.IsSpinner = false; + foreach(var item in Pizza) { - SfDropDownList CategoryRef; - SfTextBox DescriptionRef; - private string SelectedAPI = "Open AI"; - private bool ShowScore = false; - private bool IsSpinner = false; - private List Pizza = new PizzaDataModel().GetPizzaData(); - public string Content = "Check Customer Sentiments"; - private async Task GetScore() + if(item.SentimentScore > 0 && item.SentimentScore <= 2) { - this.IsSpinner = true; - string result = ""; - string json = JsonSerializer.Serialize(Pizza, new JsonSerializerOptions { WriteIndented = true }); - var description = "Provide a SentimentScore out of 5 (whole numbers only) based on the Feedback. If the feedback is null, do not give a SentimentScore. Use the dataset provided below to make recommendations. NOTE: Return the data in JSON format with all fields included, and return only JSON data, no explanatory text." + json; - result = await OpenAIService.GetCompletionAsync(description); - string data = result.Replace("```json", "").Replace("```", "").Replace("\r", "").Replace("\n", "").Replace("\t", "").Trim(); - this.Pizza = JsonSerializer.Deserialize>(data); - this.IsSpinner = false; - foreach(var item in Pizza) - { - if(item.SentimentScore > 0 && item.SentimentScore <= 2) - { - item.Emoji = "😢"; - } - else if (item.SentimentScore > 3 && item.SentimentScore <= 5) - { - item.Emoji = "😀"; - } - else if (item.SentimentScore == 3) - { - item.Emoji = "😐"; - } - } - this.ShowScore = true; - StateHasChanged(); - } - private List CategoryData = new List() - { - new DropDownModel { Id = 0, Value = "Menu" }, - new DropDownModel { Id = 1, Value = "Order" }, - new DropDownModel { Id = 2, Value = "Ready to Serve" }, - new DropDownModel { Id = 3, Value = "Delivered"}, - new DropDownModel { Id = 3, Value = "Served"}, - }; - private class DropDownModel - { - public int Id { get; set; } - public string Value { get; set; } + item.Emoji = "😢"; } - private List columnData = new List() { - new ColumnModel(){ HeaderText= "Menu", KeyField= new List() { "Menu" } }, - new ColumnModel(){ HeaderText= "Order", KeyField= new List() { "Order" } }, - new ColumnModel(){ HeaderText= "Ready to Serve", KeyField= new List() { "Ready to Serve"} }, - new ColumnModel(){ HeaderText= "Delivered", KeyField=new List() { "Delivered", "Served" } } - }; - public void Begin(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args) + else if (item.SentimentScore > 3 && item.SentimentScore <= 5) { - Content = "Analyzing..."; + item.Emoji = "😀"; } - public async Task End(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args) + else if (item.SentimentScore == 3) { - while (this.IsSpinner) - { - await Task.Delay(1000); - } - Content = "Check Cusotomer Sentiments"; + item.Emoji = "😐"; } } + this.ShowScore = true; + StateHasChanged(); } + ``` -## Error Handling and Troubleshooting +### Displaying Sentiment Results on Kanban Cards -If the AI service fails to return a valid response, the Kanban will display an error message ("Oops! Please try again!"). Common issues include: +Once the AI response is processed and `ShowScore` is set to `true`, the Kanban board updates dynamically. For cards in the Delivered or Served categories: -- **Invalid API Key or Endpoint**: Verify that the `openAIApiKey`, `azureOpenAIKey`, or Ollama `Endpoint` is correct and the service is accessible. -- **Model Unavailable**: Ensure the specified `openAIModel`, `azureOpenAIModel`, or `ModelName` is deployed and supported. -- **Network Issues**: Check connectivity to the AI service endpoint, especially for self-hosted Ollama instances. -- **Large Prompts**: Processing large text inputs may cause timeouts. Consider reducing the prompt size or optimizing the request for efficiency. +- The Emoji field is shown alongside delivery details. +- Emojis represent the sentiment score: + - 😊 Smiling face for positive feedback (score > 3) + - 😐 Neutral face for average feedback (score = 3) + - 😞 Disappointed face for negative feedback (score ≤ 2) -## Performance Considerations +This is handled in the Kanban card template using conditional rendering: -When handling large text content, ensure the Ollama server has sufficient resources (CPU/GPU) to process requests efficiently. For long-form content or batch operations, consider splitting the input into smaller segments to avoid performance bottlenecks. Test the application with your specific use case to determine optimal performance. +{% tabs %} +{% highlight razor %} + +if (card.Category == "Delivered" || card.Category == "Served") +{ +
    Delivered
    + if (ShowScore) + { + +
    +
    +
    @card.Emoji
    +
    + + } +} + +{% endhighlight %} +{% endtabs %} ## Sample Code A complete working example is available in the [Syncfusion Blazor AI Samples GitHub repository](https://github.com/syncfusion/smart-ai-samples). -![Kanban AI Assistant - Output](../../ai/images/sentiment-analysis.png) \ No newline at end of file +![Kanban AI Assistant - Output](../../ai/images/sentiment-analysis.png) + +## Error Handling and Troubleshooting + +If the AI service fails to return a valid response, the Kanban will display an error message ("Oops! Please try again!"). Common issues include: + +- **Invalid API Key or Endpoint**: Verify that the `openAIApiKey`, `azureOpenAIKey`, or Ollama `Endpoint` is correct and the service is accessible. +- **Model Unavailable**: Ensure the specified `openAIModel`, `azureOpenAIModel`, or `ModelName` is deployed and supported. +- **Network Issues**: Check connectivity to the AI service endpoint, especially for self-hosted Ollama instances. +- **Large Prompts**: Processing large text inputs may cause timeouts. Consider reducing the prompt size or optimizing the request for efficiency. + diff --git a/blazor/smart-ai-solutions/ai-samples/kanban/smart-task-suggestion.md b/blazor/smart-ai-solutions/ai-samples/kanban/smart-task-suggestion.md index a8034ddae5..63b3ae696b 100644 --- a/blazor/smart-ai-solutions/ai-samples/kanban/smart-task-suggestion.md +++ b/blazor/smart-ai-solutions/ai-samples/kanban/smart-task-suggestion.md @@ -30,7 +30,7 @@ Ensure the following NuGet packages are installed based on your chosen AI servic - **OllamaSharp** {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Syncfusion.Blazor.Kanban -Version {{ site.releaseversion }} Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} @@ -48,7 +48,7 @@ Install-Package OllamaSharp # For Ollama Include the theme stylesheet and script from NuGet via [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets) in the `` of your main page: - For **.NET 6** Blazor Server apps, add to **~/Pages/_Layout.cshtml**. -- For **.NET 8 or .NET 9** Blazor Server apps, add to **~/Components/App.razor**. +- For **.NET 8 or .NET 9 or .NET 10** Blazor Server apps, add to **~/Components/App.razor**. ```html @@ -77,7 +77,7 @@ Generate an API key from OpenAI and set `openAIApiKey`. Specify the desired mode - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -88,7 +88,7 @@ Install-Package Microsoft.Extensions.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -115,7 +115,7 @@ Deploy an Azure OpenAI Service resource and model as described in [Microsoft's d - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -127,7 +127,7 @@ Install-Package Azure.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Azure.AI.OpenAI; @@ -163,7 +163,7 @@ To use Ollama for self-hosted AI models: - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package OllamaSharp @@ -174,7 +174,7 @@ Install-Package OllamaSharp - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -202,7 +202,7 @@ Add the Syncfusion Blazor service to your **~/Program.cs** file. The configurati - **WebAssembly or Auto Mode**: Register the service in both the server-side **~/Program.cs** and client-side **~/Program.cs** files. {% tabs %} -{% highlight C# tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} +{% highlight csharp tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} using Syncfusion.Blazor; @@ -216,7 +216,7 @@ builder.Services.AddSyncfusionBlazor(); var app = builder.Build(); {% endhighlight %} -{% highlight C# tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} +{% highlight csharp tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} using Syncfusion.Blazor; @@ -228,342 +228,215 @@ await builder.Build().RunAsync(); {% endhighlight %} {% endtabs %} -## Razor Component +## AI-powered Kanban Smart Card Generation -This section demonstrates how to implement the Syncfusion Blazor Kanban component with AI-powered task generation. The AI Assistant analyzes the provided project description and automatically suggests relevant tasks, which are then displayed in the Kanban board. +The AI-powered Kanban feature integrates Blazor Kanban with an AI service to automatically generate structured task cards based on user input. This functionality simplifies project planning by allowing users to enter basic project details and the desired number of tasks. The backend logic then uses AI to create well-defined tasks, including fields like **Title**, **Description**, **Status**, and **Story Points**, and dynamically updates the Kanban board. This approach ensures faster task creation, consistent formatting, and an interactive experience for managing projects. -(`Home.razor`) +### UI Structure + +The Kanban AI interface starts with a simple form where users provide **Project Details** and the **Number of Tasks** to generate. Below these inputs, a Progress Button labeled “Generate Tasks” triggers the AI process. This button shows a loading state during task generation for better user feedback. + +- **Project Details:** A multiline text box for describing the project. +- **Number of Tasks:** A numeric input for specifying how many tasks to generate. +- **Generate Button:** A progress-enabled button that calls `GenerateTasks()` to start AI-based task creation. + +{% tabs %} +{% highlight razor %} + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +
    + +{% endhighlight %} +{% endtabs %} + +### Generating Tasks with AI + +After the user enters project details and the number of tasks, clicking Generate Tasks calls `GenerateTasks()`, which triggers `GenerateProjectTasks()` to build a detailed prompt for the AI service. This prompt includes the project description, task count, and strict instructions to return data in JSON format with fields like Id, Title, Description, Status, StoryPoints, and Color. + +The prompt is then sent to the AI using `GetCompletionAsync()`, which processes the request and returns a JSON response containing the generated tasks. The response is cleaned to remove unnecessary formatting and deserialized into a list of `SmartSuggestionDataModel` objects. These tasks are stored in `smartSuggestion` and displayed in the Kanban board or backlog view. ```csharp -@rendermode InteractiveServer -@inject AzureAIService OpenAIService -@using Syncfusion.Blazor.Kanban -@using Syncfusion.Blazor.Buttons -@using Syncfusion.Blazor.SplitButtons -@using Syncfusion.Blazor.Popups -@using Syncfusion.Blazor.Inputs -@using Syncfusion.Blazor.Notifications -@using BlazorApp4.Components.Models -@using BlazorApp4.Components.Service -@using Syncfusion.Blazor.Grids - -@if (isHomapage) +private async Task GenerateProjectTasks() { -
    -
    -
    -
    -

    AI Smart Task Suggestion

    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    + try + { + if (!string.IsNullOrEmpty(TextBoxValue) && !string.IsNullOrEmpty(TasksValue)) + { + string result = ""; + var description = $"Generate {TasksValue} task recommendations for {TextBoxValue}. Each task should include the following fields: Id (like example: ID should be in project name simple 4char word - 1), Title, Status, Description, Assignee, StoryPoints, Color and Due Date, formatted according to the dataset. Assign each task to the Assignee: empty string, set the Status to 'Open', and use black for the Color. Use the dataset provided below to create your recommendations. IMPORTANT: Return the data strictly in JSON format with all the required fields. Only the JSON data is needed, no additional text.Return only the JSON array format without any explanations."; + result = await OpenAIService.GetCompletionAsync(description); + if (result != null) + { + string data = result.Replace("```json", "").Replace("```", "").Replace("\r", "").Replace("\n", "").Replace("\t", "").Trim(); + List modifiedData; + modifiedData = JsonSerializer.Deserialize>(data); + smartSuggestion = modifiedData != null ? smartSuggestion.Concat(modifiedData).ToList() : smartSuggestion; + this.isGeneratedProjectTasks = true; + } + ContentGenerateTask = "Generate Tasks"; + } + else + { + waringText = string.IsNullOrEmpty(TextBoxValue) && string.IsNullOrEmpty(TasksValue) ? "Enter the required task creation details" : !string.IsNullOrEmpty(TasksValue) ? "Enter the Project Details" : "Enter the number of tasks"; + } + } + catch + { + await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(), ShowCloseButton = true, Timeout = 0 }); + } } -else -{ -
    -
    -
    - @if (showBacklogs) - { -
    -

    Kanban Board

    -
    - Add New Projects -
    -
    - + +``` + +### Displaying AI-Generated Tasks in Kanban Cards + +Once the AI-generated tasks are processed and stored in `smartSuggestion`, they are displayed in two ways: + +1. Kanban Board View +2. Backlog Grid View + +#### Kanban Board View + +The Kanban board uses `SfKanban` to organize tasks into columns like **To Do**, **In Progress**, **Review**, and **Done**, based on the Status field. Each card shows the task title, description, and story points using a custom template for better readability. + +- **Kanban Columns:** Defined by KeyField values such as Open, InProgress, Review, and Close. +- **Card Template:** Displays Title, Description, and StoryPoints in a structured layout. +- **Dynamic Binding:** The [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Kanban.SfKanban-1.html#Syncfusion_Blazor_Kanban_SfKanban_1_DataSource) property binds to `smartSuggestion`, ensuring that newly generated tasks appear instantly. + +{% tabs %} +{% highlight razor %} + + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +#### Backlog Grid View + +When users switch to **Backlog View**, tasks are displayed in a grid using `SfGrid`. This view allows adding, deleting, and editing tasks through a **dialog popup** for structured input. + +- **Dialog Editing:** Uses [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EditSettings) with [Dialog](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html#Syncfusion_Blazor_Grids_GridEditSettings_Dialog) mode for structured editing. +- **Validation:** Ensures required fields like Task ID, Title, and Status are filled. +- **Data Binding:** The [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_DataSource) property binds to `smartSuggestion`, just like Kanban. + +{% tabs %} +{% highlight razor %} + + + + + + + + + + + + + + -``` +{% endhighlight %} +{% endtabs %} + +**View Toggle:** Users can switch between **Kanban** and **Grid** using the button below: + +{% tabs %} +{% highlight razor %} -`Home.razor.cs` + + +{% endhighlight %} +{% endtabs %} ```csharp -using System.Text.Json; -using AISamples.Components.Models; -using Microsoft.AspNetCore.Components; -using Syncfusion.Blazor.Grids; -using Syncfusion.Blazor.Kanban; -using Syncfusion.Blazor.Notifications; - -namespace AISamples.Components.Pages +private void GoToBacklogBoardView() { - public partial class Home + if (BacklogButtonViewContent == "View as Board") { - SfToast ToastObj; - public string[] SelectedAssignees { get; set; } = new string[] { }; - private string ToastTarget { get; set; } = "#toast-kanban-observable"; - SfKanban kanbanObj; - public string ContentGenerateTask = "Generate Tasks"; - public string BacklogButtonViewContent = "View as Backlog"; - private string TextBoxValue = string.Empty; - private string TasksValue = string.Empty; - private bool enableProjectDetailsDialog = false; - private bool isGeneratedProjectTasks = false; - private bool enableTaskEditing = false; - private bool isHomapage = true; - private bool showSprintBoard = false; - private bool showBacklogs = false; - private bool showBacklogBoard = true; - private List smartSuggestion = new List(); - private DialogSettings DialogParams = new DialogSettings { MinHeight = "400px", Width = "450px" }; - private string waringText = "Click \"Generate Tasks\" to preview"; - private void GoToBacklogBoardView() - { - if (BacklogButtonViewContent == "View as Board") - { - BacklogButtonViewContent = "View as Backlog"; - showBacklogBoard = true; - } - else - { - showBacklogBoard = false; - BacklogButtonViewContent = "View as Board"; - } - showSprintBoard = false; - } - private RenderFragment GetTemplate() => builder => - { - builder.OpenElement(0, "div"); - builder.AddContent(1, "An error occurred during the AI process, Please try again."); - builder.CloseElement(); - }; - public void BeginGenerateTasks(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args) - { - ContentGenerateTask = "Generating..."; - } - public async Task EndGenerateTasks(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args) - { - while (!isGeneratedProjectTasks) - { - await Task.Delay(1000); - } - this.isHomapage = false; - this.CloseDialog(); - showBacklogs = true; - } - private async Task GenerateProjectTasks() - { - try - { - if (!string.IsNullOrEmpty(TextBoxValue) && !string.IsNullOrEmpty(TasksValue)) - { - string result = ""; - var description = $"Generate {TasksValue} task recommendations for {TextBoxValue}. Each task should include the following fields: Id (like example: ID should be in project name simple 4char word - 1), Title, Status, Description, Assignee, StoryPoints, Color and Due Date, formatted according to the dataset. Assign each task to the Assignee: empty string, set the Status to 'Open', and use black for the Color. Use the dataset provided below to create your recommendations. IMPORTANT: Return the data strictly in JSON format with all the required fields. Only the JSON data is needed, no additional text.Return only the JSON array format without any explanations."; - result = await OpenAIService.GetCompletionAsync(description); - if (result != null) - { - string data = result.Replace("```json", "").Replace("```", "").Replace("\r", "").Replace("\n", "").Replace("\t", "").Trim(); - List modifiedData; - modifiedData = JsonSerializer.Deserialize>(data); - smartSuggestion = modifiedData != null ? smartSuggestion.Concat(modifiedData).ToList() : smartSuggestion; - this.isGeneratedProjectTasks = true; - } - ContentGenerateTask = "Generate Tasks"; - } - else - { - waringText = string.IsNullOrEmpty(TextBoxValue) && string.IsNullOrEmpty(TasksValue) ? "Enter the required task creation details" : !string.IsNullOrEmpty(TasksValue) ? "Enter the Project Details" : "Enter the number of tasks"; - } - } - catch - { - await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(), ShowCloseButton = true, Timeout = 0 }); - } - } - private void OpenProjectDetailsDialog() - { - this.enableProjectDetailsDialog = true; - } - private async Task GenerateTasks() - { - this.isGeneratedProjectTasks = false; - await this.GenerateProjectTasks(); - } - private void SaveTask() - { - this.enableProjectDetailsDialog = false; - this.TasksValue = string.Empty; - this.TextBoxValue = string.Empty; - this.isGeneratedProjectTasks = false; - StateHasChanged(); - } - private void CloseDialog() - { - this.enableProjectDetailsDialog = false; - this.TasksValue = string.Empty; - this.TextBoxValue = string.Empty; - this.isGeneratedProjectTasks = false; - StateHasChanged(); - } - public void TaskEditingHandler(Syncfusion.Blazor.Grids.ActionEventArgs args) - { - if (args.RequestType.ToString() == "Add") - { - enableTaskEditing = true; - } - else - { - enableTaskEditing = false; - } - } - public void RowCreatedHandler(RowCreatedEventArgs args) - { - args.Data.Status = "Open"; - args.Data.Color = "#000000"; - } + BacklogButtonViewContent = "View as Backlog"; + showBacklogBoard = true; + } + else + { + showBacklogBoard = false; + BacklogButtonViewContent = "View as Board"; } } - ``` +## Sample Code + +A complete working example is available in the [Syncfusion Blazor AI Samples GitHub repository](https://github.com/syncfusion/smart-ai-samples). + +![Kanban AI Assistant - Output](../../ai/images/smart-task-suggestion.png) + ## Error Handling and Troubleshooting If the AI service fails to return a valid response, the Kanban will display an error message ("Oops! Please try again!"). Common issues include: @@ -573,12 +446,3 @@ If the AI service fails to return a valid response, the Kanban will display an e - **Network Issues**: Check connectivity to the AI service endpoint, especially for self-hosted Ollama instances. - **Large Prompts**: Processing large text inputs may cause timeouts. Consider reducing the prompt size or optimizing the request for efficiency. -## Performance Considerations - -When handling large text content, ensure the Ollama server has sufficient resources (CPU/GPU) to process requests efficiently. For long-form content or batch operations, consider splitting the input into smaller segments to avoid performance bottlenecks. Test the application with your specific use case to determine optimal performance. - -## Sample Code - -A complete working example is available in the [Syncfusion Blazor AI Samples GitHub repository](https://github.com/syncfusion/smart-ai-samples). - -![Kanban AI Assistant - Output](../../ai/images/smart-task-suggestion.png) \ No newline at end of file diff --git a/blazor/smart-ai-solutions/ai-samples/pivot-table/smart-pivot.md b/blazor/smart-ai-solutions/ai-samples/pivot-table/smart-pivot.md index d2db103885..547de36a03 100644 --- a/blazor/smart-ai-solutions/ai-samples/pivot-table/smart-pivot.md +++ b/blazor/smart-ai-solutions/ai-samples/pivot-table/smart-pivot.md @@ -59,7 +59,7 @@ Install-Package OllamaSharp # For Ollama Include the theme stylesheet and script via [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets) in the `` of your main page: - For **.NET 6** Blazor Server apps, add to **~/Pages/_Layout.cshtml**. -- For **.NET 8 or .NET 9** Blazor Server apps, add to **~/Components/App.razor**. +- For **.NET 8 or .NET 9 or .NET 10** Blazor Server apps, add to **~/Components/App.razor**. ```html @@ -277,7 +277,7 @@ The following example shows how to set up these features in your Blazor applicat

    - +
    @@ -867,4 +867,4 @@ A complete working example is available in the [Syncfusion Blazor AI Samples Git Explore the AI-powered Smart Pivot Table in action by visiting the live demo: -👉 [Try the Live Demo](https://blazor.syncfusion.com/demos/pivot-table/ai-smart-pivot?theme=fluent2) \ No newline at end of file +👉 [Try the Live Demo](https://blazor.syncfusion.com/demos/pivot-table/ai-smart-pivot?theme=fluent2) diff --git a/blazor/smart-ai-solutions/ai-samples/rich-text-editor/writting-assistance.md b/blazor/smart-ai-solutions/ai-samples/rich-text-editor/writting-assistance.md index 3074d17360..b6a21e6c14 100644 --- a/blazor/smart-ai-solutions/ai-samples/rich-text-editor/writting-assistance.md +++ b/blazor/smart-ai-solutions/ai-samples/rich-text-editor/writting-assistance.md @@ -30,7 +30,7 @@ Ensure the following NuGet packages are installed based on your chosen AI servic - **OllamaSharp** {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Syncfusion.Blazor.RichTextEditor -Version {{ site.releaseversion }} Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }} @@ -48,7 +48,7 @@ Install-Package OllamaSharp # For Ollama Include the theme stylesheet and script from NuGet via [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets) in the `` of your main page: - For **.NET 6** Blazor Server apps, add to **~/Pages/_Layout.cshtml**. -- For **.NET 8 or .NET 9** Blazor Server apps, add to **~/Components/App.razor**. +- For **.NET 8 or .NET 9 or .NET 10** Blazor Server apps, add to **~/Components/App.razor**. ```html @@ -77,7 +77,7 @@ Generate an API key from OpenAI and set `openAIApiKey`. Specify the desired mode - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -88,7 +88,7 @@ Install-Package Microsoft.Extensions.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -115,7 +115,7 @@ Deploy an Azure OpenAI Service resource and model as described in [Microsoft's d - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package Microsoft.Extensions.AI.OpenAI @@ -127,7 +127,7 @@ Install-Package Azure.AI.OpenAI - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Azure.AI.OpenAI; @@ -163,7 +163,7 @@ To use Ollama for self-hosted AI models: - Install the required NuGet packages: {% tabs %} -{% highlight C# tabtitle="Package Manager" %} +{% highlight csharp tabtitle="Package Manager" %} Install-Package Microsoft.Extensions.AI Install-Package OllamaSharp @@ -174,7 +174,7 @@ Install-Package OllamaSharp - Add the following to the **~/Program.cs** file in your Blazor WebApp: {% tabs %} -{% highlight C# tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} +{% highlight csharp tabtitle="Blazor WebApp" hl_lines="7 8 9 11 12 13" %} using Syncfusion.Blazor.AI; using Microsoft.Extensions.AI; @@ -202,7 +202,7 @@ Add the Syncfusion Blazor service to your **~/Program.cs** file. The configurati - **WebAssembly or Auto Mode**: Register the service in both the server-side **~/Program.cs** and client-side **~/Program.cs** files. {% tabs %} -{% highlight C# tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} +{% highlight csharp tabtitle="Server (~/_Program.cs)" hl_lines="3 11" %} using Syncfusion.Blazor; @@ -216,7 +216,7 @@ builder.Services.AddSyncfusionBlazor(); var app = builder.Build(); {% endhighlight %} -{% highlight C# tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} +{% highlight csharp tabtitle="Client (~/_Program.cs)" hl_lines="2 5" %} using Syncfusion.Blazor; @@ -228,432 +228,376 @@ await builder.Build().RunAsync(); {% endhighlight %} {% endtabs %} -## Razor Component +## AI-powered Rich Text Editor in Blazor -This section implements the Syncfusion Blazor Rich Text Editor with AI-powered content assistance features such as rephrase, correct grammar, summarize, elaborate, and translate. +This guide explains how to integrate a full-featured AI writing assistant into the Blazor Rich Text Editor using Azure OpenAI (via Semantic Kernel). The implementation supports **Rephrase**, **Correct Grammar**, **Summarize**, **Elaborate**, and **Translate** with live preview, dynamic tone and language controls, skeleton loading, and safe content replacement with undo support. -(`Home.razor`) +### How the Custom Toolbar is Rendered -```csharp -@inject AzureAIService semanticKernelAI -@inject IJSRuntime JSRuntime -@using AISamples.Components.Service -@using Syncfusion.Blazor.RichTextEditor -@using Syncfusion.Blazor.SplitButtons -@using Syncfusion.Blazor.Buttons -@using Syncfusion.Blazor.Popups -@using Syncfusion.Blazor.Notifications -@using Syncfusion.Blazor.DropDowns - -
    - - - - - - - - - - - - - -
    -
    - - -
    AI Assistant
    - -
    -
    -
    - - +The toolbar uses [RichTextEditorCustomToolbarItems](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorCustomToolbarItems.html) to inject a custom item named AI. + +Inside the template, an `SfDropDownButton` is rendered with: + +- **Icon**: AI icon (e-icons e-ai-chat) +- **Dropdown Items**: Rephrase, Grammar, Summarize, Elaborate, Translate +- **Event Binding**: ItemSelected="AIQuerySelectedMenu" triggers the AI workflow when an option is selected. + +An additional `SfButton` for **Rephrase** is provided for quick access. + +{% tabs %} +{% highlight razor %} + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +### AI Assistant Dialog – Layout and Dynamic Controls + +The AI Assistant dialog provides a responsive, user-friendly interface for interacting with AI-generated content. It is designed as a modal dialog that overlays the editor and ensures proper z-index stacking for seamless integration. + +#### Dialog Structure + +The dialog is divided into two main rows: + +**Row 1:** Action Selection and Dynamic Controls + +- **Action Dropdown:** Allows users to switch between AI actions (Rephrase, Grammar, Summarize, Elaborate, Translate). +- **Dynamic Controls:** + - **Tone Chips** (Standard, Fluent, Professional) appear when the selected action is Rephrase. + - **Language Dropdown** (15+ languages) appears when the selected action is Translate. + +**Row 2:** Original Text vs AI Result + +- **Left Panel:** Displays the original selected text in a read-only Rich Text Editor. +- **Right Panel:** Shows AI-generated content in another Rich Text Editor. +- **Loading State:** While AI processes the request, a progressive skeleton loader animates from 100% to 10% width for visual feedback. +- **Fallback State:** If no result is returned, a “No results found” message with a warning icon is displayed. + +**Footer Actions** + +- **Regenerate:** Requests a new AI output for the same prompt. +- **Copy:** Copies the AI-generated content to the clipboard. +- **Replace:** Inserts the AI-generated content back into the original editor with undo support. + +{% tabs %} +{% highlight razor %} + + + + +
    + AI Assistant +
    + + + +
    +
    +
    + + + + + + +
    +
    + +
    + @if (this.enableRephraseChips) + { + + + + + + + + + + } + else if (this.enableLanguageList) + { +
    + Target Language +
    +
    + + - +
    -
    -
    - @if (this.enableRephraseChips) - { - - - - - - - - - } - else if (this.enableLanguageList) - { -
    - Target Language -
    -
    - - - - -
    - } -
    + }
    -
    -
    -
    - - - -
    +
    + +
    +
    +
    + + + +
    - @if (!isContentGenerating) +
    + + @if (!isContentGenerating) + { + @if (noResultsFound) { - @if (noResultsFound) - { -
    -
    -
    - -
    No results found
    -
    -
    -
    - } - else { -
    -
    - - - + +
    +
    +
    + +
    No results found
    - } - } else { +
    + } + else {
    -
    -
    -
    -
    -
    -
    - -
    + + + +
    } -
    - - -
    -
    + } else { +
    - Regenerate +
    + +
    +
    +
    +
    +
    + +
    -
    - @if (!string.IsNullOrEmpty(sentiment)) { - - } - Copy - Replace + } +
    + + + +
    +
    +
    + + Regenerate
    - - - - -
    - - - +
    + @if (!string.IsNullOrEmpty(sentiment)) { + + } + + Copy + Replace +
    +
    + + + + + +{% endhighlight %} +{% endtabs %} + +### Opening the AI Dialog and Preserving Selection + +The `DialogueOpen()` method opens the AI dialog when an action is selected and prepares the editor for processing. It first uses `GetSelectedHtmlAsync()` to capture the highlighted content with its formatting. If no text is selected, a toast message alerts the user to select content before proceeding. + +When valid text is found, the method makes the dialog visible, stores the selected HTML for AI processing, and calls `SaveSelectionAsync()` to preserve the cursor position so the AI output can replace only the selected text later. It then refreshes the dialog’s editor and updates AI suggestions based on the chosen action. + + +```csharp +private async Task Rephrase() +{ + // Directly open dialog for Rephrase action + await DialogueOpen("Rephrase"); +} +private async Task AIQuerySelectedMenu(MenuEventArgs args) +{ + // Open dialog based on selected dropdown item + await DialogueOpen(args.Item.Text); +} +private async Task DialogueOpen(string selectedQuery) +{ + // Get the selected text from the RichTextEditor + var selectionText = await rteObj.GetSelectedHtmlAsync(); + + if (!string.IsNullOrEmpty(selectionText)) + { + // Make the dialog visible + dialogVisible = true; + + // Identify the selected query and map it to its ID + + dropVal = QueryList.FirstOrDefault(q => q.Text.Equals(selectedQuery, StringComparison.OrdinalIgnoreCase))?.ID; + + // Store the selected text for AI processing + promptQuery = selectionText; + + // Save the current selection so AI output can be inserted later + await this.rteObj.SaveSelectionAsync(); + + // Refresh the left-side RichTextEditor in the dialog to show original text + await this.leftRteChildObj.RefreshUIAsync(); + + // Update AI suggestions based on the selected query + await UpdateAISuggestionsData(selectedQuery); + } + else + { + // Show a toast notification if no text is selected + await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(true), ShowCloseButton = true, Timeout = 0 }); + } +} ``` -`Home.razor.cs` +### Building and Sending the AI + +The AI prompt is built in two parts: **user intent** and **system instruction**. + +1. **User Intent (subQuery)** - Defines what the AI should do, such as summarizing, rephrasing with a specific tone, or translating into a target language. This makes the prompt context-aware and action-specific. + +2. **System Instruction (HTML preservation)** - Enforces formatting rules, for example: “Retain existing HTML structure. Modify content only.” This ensures that the AI preserves elements like bold text, lists, and links while updating the content. + +Both parts are combined and sent to `semanticKernelAI.GetCompletionAsync()` via Semantic Kernel, resulting in an AI-generated output that is accurate and safe to insert back into the editor. ```csharp -using Markdig; -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using Syncfusion.Blazor.DropDowns; -using Syncfusion.Blazor.Inputs; -using Syncfusion.Blazor.Notifications; -using Syncfusion.Blazor.RichTextEditor; -using Syncfusion.Blazor.SplitButtons; - -namespace AISamples.Components.Pages + +private async Task UpdateAISuggestionsData(string selectedQuery) { - public partial class Home + enableRephraseChips = false; + enableLanguageList = false; + isSentimentCheck = false; + switch (selectedQuery) { - SfToast ToastObj; - private string ToastTarget { get; set; } = "#scroll-restricted"; - SfRichTextEditor rteObj; - SfRichTextEditor leftRteChildObj; - SfRichTextEditor rightRteChildObj; - private string Value { get; set; } = "
    Integrate AI with the Editor

    Integrate the AI assistant into the rich text editor by capturing the content from the editor, sending it to the AI service, and displaying the results or suggestions back in the editor.

    Summarize

    This function condenses the selected content into a brief summary, capturing the main points succinctly.

    Elaborate

    This function expands the selected content, adding additional details and context.

    Rephrase

    This function rewrites the selected content to convey the same meaning using different words or structures. It also enables rephrase options and disables language selection.

    Correct Grammar

    This function reviews and corrects the grammar of the selected content, ensuring it adheres to standard grammatical rules.

    Translate

    This function translates the selected content into the specified language, enabling language selection and disabling rephrase options.

    "; - private bool dialogVisible { get; set; } - private bool enabelAIAssitantButton { get; set; } = false; - private bool enabelRegenerateContentButton { get; set; } = false; - private bool enabelContentButton { get; set; } = true; - private string promptQuery = string.Empty; - private string subQuery = string.Empty; - private string[] chipValue = new[] { "Standard" }; - private string translatelanguage = "EN"; - private string dropVal { get; set; } = "Rephrase"; - private bool enableRephraseChips { get; set; } = true; - private bool enableLanguageList { get; set; } = false; - private bool noResultsFound { get; set; } = false; - public bool isContentGenerating { get; set; } = true; - private string AIResult { get; set; } = string.Empty; - private bool isSentimentCheck { get; set; } = false; - private MarkdownPipeline pipeline { get; set; } = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); - private string sentiment = ""; - private string apiResultData = ""; - private string ButtonClass = "e-tbar-btn"; - private void UpdateStatus(Syncfusion.Blazor.RichTextEditor.ChangeEventArgs args) - { - Value = args.Value; - enabelAIAssitantButton = string.IsNullOrWhiteSpace(Value); - } - private void OnActionCompleteHandler(Syncfusion.Blazor.RichTextEditor.ActionCompleteEventArgs args) - { - if (args.RequestType == "SourceCode") - { - this.ButtonClass = "e-tbar-btn e-overlay"; - } - if (args.RequestType == "Preview") - { - this.ButtonClass = "e-tbar-btn"; - } - } - private void UpdateTextAreaStatus(InputEventArgs args) - { - Value = args.Value; - enabelRegenerateContentButton = string.IsNullOrWhiteSpace(Value); - } - private async Task AIQuerySelectedMenu(MenuEventArgs args) - { - await DialogueOpen(args.Item.Text); - } - private async Task Rephrase() - { - await DialogueOpen("Rephrase"); - } - private async Task DialogueOpen(string selectedQuery) - { - var selectionText = await rteObj.GetSelectedHtmlAsync(); - if (!string.IsNullOrEmpty(selectionText)) - { - dialogVisible = true; - dropVal = QueryList.FirstOrDefault(q => q.Text.Equals(selectedQuery, StringComparison.OrdinalIgnoreCase))?.ID; - promptQuery = selectionText; - await this.rteObj.SaveSelectionAsync(); - await this.leftRteChildObj.RefreshUIAsync(); - await UpdateAISuggestionsData(selectedQuery); - } - else - { - await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(true), ShowCloseButton = true, Timeout = 0 }); - } - } - private async Task SelectedChipsChanged(Syncfusion.Blazor.Buttons.SelectionChangedEventArgs args) - { - if (chipValue.Length == 0 && args != null && args.RemovedItems.Length > 0) - { - chipValue = new [] { args.RemovedItems[0] }; - } - await UpdateAISuggestionsData("Rephrase"); - } - private async Task AITranslateDropdownList(ChangeEventArgs args) - { - await UpdateAISuggestionsData("Translate"); - } - private async Task AIQuerySelectedDropdownList(ChangeEventArgs args) - { - if (!string.IsNullOrEmpty(dropVal)) - { - chipValue = new[] { "Standard" }; - translatelanguage = "EN"; - var selectedQuery = QueryList.FirstOrDefault(q => q.ID.Equals(dropVal, StringComparison.OrdinalIgnoreCase))?.Text; - await UpdateAISuggestionsData(selectedQuery); - } - } - private async Task UpdateAISuggestionsData(string selectedQuery) - { - enableRephraseChips = false; - enableLanguageList = false; - isSentimentCheck = false; - switch (selectedQuery) - { - case "Summarize": - subQuery = "Briefly summarize the following text in a short and concise manner."; - break; - case "Elaborate": - subQuery = "Elaborate/Expand on the following text, providing more detail and context."; - break; - case "Rephrase": - enableRephraseChips = true; - enableLanguageList = false; - subQuery = $"Rephrase the following text in a {chipValue[0]} [tone/style], ensuring clarity and maintaining the original meaning."; - break; - case "Correct Grammar": - subQuery = "Correct any grammatical errors in the following text, ensuring it is clear and well-structured."; - break; - case "Translate": - enableLanguageList = true; - enableRephraseChips = false; - subQuery = $"Translate the following text into {translatelanguage}, preserving the original meaning and tone."; - break; - } - UpdateAISuggestionsData(); - } - private async Task RegenerateContent() - { - UpdateAISuggestionsData(); - } - private async Task ReplaceContent() - { - ExecuteCommandOption executeCommandOption = new ExecuteCommandOption(); - executeCommandOption.Undo = true; - await this.rteObj.RestoreSelectionAsync(); - await this.rteObj.ExecuteCommandAsync(CommandName.InsertHTML, this.apiResultData, executeCommandOption); - await CloseDialog(); - } - private async Task CopyContent() - { - await JSRuntime.InvokeVoidAsync("copyToClipboard", Markdig.Markdown.ToPlainText(AIResult, pipeline)); - } - private async Task CloseDialog() - { - dialogVisible = false; - promptQuery = string.Empty; - AIResult = string.Empty; - chipValue = new[] { "Standard" }; - dropVal = "Query1"; + case "Summarize": + subQuery = "Briefly summarize the following text in a short and concise manner."; + break; + case "Elaborate": + subQuery = "Elaborate/Expand on the following text, providing more detail and context."; + break; + case "Rephrase": enableRephraseChips = true; enableLanguageList = false; - sentiment = ""; - apiResultData = ""; - } - private async Task UpdateAISuggestionsData() + subQuery = $"Rephrase the following text in a {chipValue[0]} [tone/style], ensuring clarity and maintaining the original meaning."; + break; + case "Correct Grammar": + subQuery = "Correct any grammatical errors in the following text, ensuring it is clear and well-structured."; + break; + case "Translate": + enableLanguageList = true; + enableRephraseChips = false; + subQuery = $"Translate the following text into {translatelanguage}, preserving the original meaning and tone."; + break; + } + UpdateAISuggestionsData(); +} + +private async Task UpdateAISuggestionsData() +{ + try + { + if (!string.IsNullOrEmpty(promptQuery)) { - try - { - if (!string.IsNullOrEmpty(promptQuery)) - { - enabelRegenerateContentButton = isContentGenerating = enabelContentButton = true; - string systemPrompt = subQuery.Contains("emoji followed by the sentiment in the format") ? "You are a helpful assistant. Please respond in string format." : "NOTE:Please retain the existing HTML structure and modify the content only. Ensure that the response adheres to the specified formatting."; - apiResultData = await semanticKernelAI.GetCompletionAsync(promptQuery, false, false, (subQuery + systemPrompt)); - if (apiResultData != null) - { - isContentGenerating = false; - sentiment = isSentimentCheck ? apiResultData.Replace("\"", "").Replace("'", "") : ""; - AIResult = isSentimentCheck ? promptQuery : apiResultData; - noResultsFound = string.IsNullOrEmpty(AIResult) || string.IsNullOrEmpty(promptQuery); - enabelRegenerateContentButton = enabelContentButton = noResultsFound; - await InvokeAsync(StateHasChanged); - } - else - { - isContentGenerating = false; - await InvokeAsync(StateHasChanged); - } - } - } - catch - { - await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(), ShowCloseButton = true, Timeout = 0 }); - } - } - private RenderFragment GetTemplate(bool hasTextSelection = false) => builder => - { - builder.OpenElement(0, "div"); - builder.AddContent(1, hasTextSelection ? "Please select the content to perform the AI operation." : "An error occurred during the AI process, Please try again."); - builder.CloseElement(); - }; - public class SubQuery + enabelRegenerateContentButton = isContentGenerating = enabelContentButton = true; + string systemPrompt = subQuery.Contains("emoji followed by the sentiment in the format") ? "You are a helpful assistant. Please respond in string format." : "NOTE:Please retain the existing HTML structure and modify the content only. Ensure that the response adheres to the specified formatting."; + apiResultData = await semanticKernelAI.GetCompletionAsync(promptQuery, false, false, (subQuery + systemPrompt)); + if (apiResultData != null) { - public string ID { get; set; } - public string Text { get; set; } + isContentGenerating = false; + sentiment = isSentimentCheck ? apiResultData.Replace("\"", "").Replace("'", "") : ""; + AIResult = isSentimentCheck ? promptQuery : apiResultData; + noResultsFound = string.IsNullOrEmpty(AIResult) || string.IsNullOrEmpty(promptQuery); + enabelRegenerateContentButton = enabelContentButton = noResultsFound; + await InvokeAsync(StateHasChanged); } - public class Languages + else { - public string ID { get; set; } - public string Text { get; set; } + isContentGenerating = false; + await InvokeAsync(StateHasChanged); } - public List QueryList = new List - { - new SubQuery { ID = "Rephrase", Text = "Rephrase" }, - new SubQuery { ID = "Grammar", Text = "Correct Grammar" }, - new SubQuery { ID = "Summarize", Text = "Summarize" }, - new SubQuery { ID = "Elaborate", Text = "Elaborate" }, - new SubQuery { ID = "Translate", Text = "Translate" } - }; - public List LanguageList = new List - { - new Languages { ID = "EN", Text = "English" }, - new Languages { ID = "ZH", Text = "Chinese (Simplified)" }, - new Languages { ID = "ZHT", Text = "Chinese (Traditional)" }, - new Languages { ID = "ES", Text = "Spanish" }, - new Languages { ID = "HI", Text = "Hindi" }, - new Languages { ID = "AR", Text = "Arabic" }, - new Languages { ID = "BN", Text = "Bengali" }, - new Languages { ID = "PT", Text = "Portuguese" }, - new Languages { ID = "RU", Text = "Russian" }, - new Languages { ID = "JA", Text = "Japanese" }, - new Languages { ID = "DE", Text = "German" }, - new Languages { ID = "KO", Text = "Korean" }, - new Languages { ID = "FR", Text = "French" }, - new Languages { ID = "IT", Text = "Italian" }, - new Languages { ID = "TR", Text = "Turkish" } - }; - private List Tools = new List() - { - new ToolbarItemModel() { Name = "AIAssistant", TooltipText = "AI Assistant" }, - new ToolbarItemModel() { Name = "Rephrase", TooltipText = "Rephrase" }, - new ToolbarItemModel() { Command = ToolbarCommand.Bold }, - new ToolbarItemModel() { Command = ToolbarCommand.Italic }, - new ToolbarItemModel() { Command = ToolbarCommand.Underline }, - new ToolbarItemModel() { Command = ToolbarCommand.Separator }, - new ToolbarItemModel() { Command = ToolbarCommand.FontName }, - new ToolbarItemModel() { Command = ToolbarCommand.FontSize }, - new ToolbarItemModel() { Command = ToolbarCommand.FontColor }, - new ToolbarItemModel() { Command = ToolbarCommand.Separator }, - new ToolbarItemModel() { Command = ToolbarCommand.BackgroundColor }, - new ToolbarItemModel() { Command = ToolbarCommand.Formats }, - new ToolbarItemModel() { Command = ToolbarCommand.Alignments }, - new ToolbarItemModel() { Command = ToolbarCommand.Separator }, - new ToolbarItemModel() { Command = ToolbarCommand.NumberFormatList }, - new ToolbarItemModel() { Command = ToolbarCommand.BulletFormatList }, - new ToolbarItemModel() { Command = ToolbarCommand.CreateLink }, - new ToolbarItemModel() { Command = ToolbarCommand.Image }, - new ToolbarItemModel() { Command = ToolbarCommand.Separator }, - new ToolbarItemModel() { Command = ToolbarCommand.CreateTable }, - new ToolbarItemModel() { Command = ToolbarCommand.SourceCode }, - new ToolbarItemModel() { Command = ToolbarCommand.Undo }, - new ToolbarItemModel() { Command = ToolbarCommand.Redo }, - }; + } + } + catch + { + await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(), ShowCloseButton = true, Timeout = 0 }); } } + +``` + +### Replacing AI Result Back into the Editor (with Undo Support) + +Once the AI-generated content is ready, it needs to be inserted exactly where the user originally selected text, without disturbing the rest of the document. This is achieved using the [ExecuteCommandAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_ExecuteCommandAsync_Syncfusion_Blazor_RichTextEditor_CommandName_System_String_Syncfusion_Blazor_RichTextEditor_ExecuteCommandOption_) method with the `InsertHTML` command. The `Undo` option is enabled to allow users to revert changes if needed. + +Additionally, users can copy the AI-generated content to the clipboard for use elsewhere. This is handled via a `JavaScript interop` function that copies plain text extracted from the AI result. + +{% tabs %} +{% highlight razor %} + + + Copy + Replace + + +{% endhighlight %} +{% endtabs %} + +```csharp + +private async Task ReplaceContent() +{ + ExecuteCommandOption executeCommandOption = new ExecuteCommandOption(); + executeCommandOption.Undo = true; + await this.rteObj.RestoreSelectionAsync(); // Return to original selection + await this.rteObj.ExecuteCommandAsync(CommandName.InsertHTML, this.apiResultData, executeCommandOption); + await CloseDialog(); +} +private async Task CopyContent() +{ + await JSRuntime.InvokeVoidAsync("copyToClipboard", Markdig.Markdown.ToPlainText(AIResult, pipeline)); +} + +``` + -``` +## Workflow Summary + +Select text → Choose AI action → Dialog opens → AI processes → Updated content displayed → User copies or replaces content. + +## Sample Code + +A complete working example is available in the [Syncfusion Blazor AI Samples GitHub repository](https://github.com/syncfusion/smart-ai-samples). + +![Rich Text Editor AI Assistant - Output](../../ai/images/richtexteditor-ai-assistant.png) ## Error Handling and Troubleshooting @@ -695,13 +647,3 @@ If the AI service fails to return a valid response, the Rich Text Editor will di - **Model Unavailable**: Ensure the specified `openAIModel`, `azureOpenAIModel`, or `ModelName` is deployed and supported. - **Network Issues**: Check connectivity to the AI service endpoint, especially for self-hosted Ollama instances. - **Large Prompts**: Processing large text inputs may cause timeouts. Consider reducing the prompt size or optimizing the request for efficiency. - -## Performance Considerations - -When handling large text content, ensure the Ollama server has sufficient resources (CPU/GPU) to process requests efficiently. For long-form content or batch operations, consider splitting the input into smaller segments to avoid performance bottlenecks. Test the application with your specific use case to determine optimal performance. - -## Sample Code - -A complete working example is available in the [Syncfusion Blazor AI Samples GitHub repository](https://github.com/syncfusion/smart-ai-samples). - -![Rich Text Editor AI Assistant - Output](../../ai/images/richtexteditor-ai-assistant.png) \ No newline at end of file diff --git a/blazor/smart-ai-solutions/ai-samples/treegrid/adaptive-structuring.md b/blazor/smart-ai-solutions/ai-samples/treegrid/adaptive-structuring.md index 2dca167da5..e8cdfe736c 100644 --- a/blazor/smart-ai-solutions/ai-samples/treegrid/adaptive-structuring.md +++ b/blazor/smart-ai-solutions/ai-samples/treegrid/adaptive-structuring.md @@ -48,7 +48,7 @@ Install-Package OllamaSharp # For Ollama Include the theme stylesheet and script from NuGet via [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets) in the `` of the main page: - For **.NET 6** Blazor Server apps, add to **~/Pages/_Layout.cshtml**. -- For **.NET 8 or .NET 9** Blazor Server apps, add to **~/Components/App.razor**. +- For **.NET 8 or .NET 9 or .NET 10** Blazor Server apps, add to **~/Components/App.razor**. ```html diff --git a/blazor/smart-paste/getting-started.md b/blazor/smart-paste/getting-started.md index 2ae43c9e0a..0ce779c137 100644 --- a/blazor/smart-paste/getting-started.md +++ b/blazor/smart-paste/getting-started.md @@ -299,7 +299,7 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A * For **.NET 6** Blazor Server app, include it in **~/Pages/_Layout.cshtml** file. -* For **.NET 9 and .NET 8** Blazor Server app, include it in the **~/Components/App.razor** file. +* For **.NET 10, .NET 9 and .NET 8** Blazor Server app, include it in the **~/Components/App.razor** file. ```html diff --git a/blazor/smart-textarea/getting-started.md b/blazor/smart-textarea/getting-started.md index dabfc1769b..fc6f1b78ea 100644 --- a/blazor/smart-textarea/getting-started.md +++ b/blazor/smart-textarea/getting-started.md @@ -298,7 +298,7 @@ The theme stylesheet and script can be accessed from NuGet through [Static Web A * For **.NET 6** Blazor Server app, include it in **~/Pages/_Layout.cshtml** file. -* For **.NET 9 and .NET 8** Blazor Server app, include it in the **~/Components/App.razor** file. +* For **.NET 10, .NET 9 and .NET 8** Blazor Server app, include it in the **~/Components/App.razor** file. ```html diff --git a/blazor/timeline/align.md b/blazor/timeline/align.md index 9259dc8481..af7f84cc86 100644 --- a/blazor/timeline/align.md +++ b/blazor/timeline/align.md @@ -50,9 +50,7 @@ In [`Before`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Layouts.Ti ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNrSMXMNhTCgiUvW?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Before Alignment](./images/Blazor-align-before.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNrSMXMNhTCgiUvW?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Before Alignment](./images/Blazor-align-before.png)" %} ## After @@ -93,9 +91,7 @@ In [`After`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Layouts.Tim ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDBysNCtBpLrvjno?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with After Alignment](./images/Blazor-align-after.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDBysNCtBpLrvjno?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with After Alignment](./images/Blazor-align-after.png)" %} ## Alternate @@ -136,9 +132,7 @@ In [`Alternate`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Layouts ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZVIiDiDLprmoLpT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Alternate Alignment](./images/Blazor-align-alternate.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZVIiDiDLprmoLpT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Alternate Alignment](./images/Blazor-align-alternate.png)" %} ## Alternate Reverse @@ -179,6 +173,4 @@ In [`AlternateReverse`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rNreWNWXhzAhJPqo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Alternate Reverse Alignment](./images/Blazor-align-alternatereverse.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/rNreWNWXhzAhJPqo?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Alternate Reverse Alignment](./images/Blazor-align-alternatereverse.png)" %} \ No newline at end of file diff --git a/blazor/timeline/customization.md b/blazor/timeline/customization.md index 96518bd5ca..29153980e4 100644 --- a/blazor/timeline/customization.md +++ b/blazor/timeline/customization.md @@ -59,9 +59,7 @@ Define styles applicable to all Timeline item connectors. The CSS selector `.e-t ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZrSsXCtVJSVQymc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Common Customized Connector](./images/Blazor-connector-common.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZrSsXCtVJSVQymc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Common Customized Connector](./images/Blazor-connector-common.png)" %} ### Individual Styling @@ -113,9 +111,7 @@ Apply unique styles to individual connectors to differentiate specific items wit ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BjVIijCXVzSGcbwr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Individual Customized Connector](./images/Blazor-connector-individual.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BjVIijCXVzSGcbwr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Individual Customized Connector](./images/Blazor-connector-individual.png)" %} ## Dot Styling @@ -177,9 +173,7 @@ Modify the color of the dots to highlight specific Timeline items. The `.e-dot` ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BZBosDWNVzniYHpT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Customized Dot color](./images/Blazor-custom-dot-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BZBosDWNVzniYHpT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Customized Dot color](./images/Blazor-custom-dot-color.png)" %} ### Dot Size @@ -243,9 +237,7 @@ Adjust the dot size using the `--dot-size` CSS variable, making it larger or sma ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BNhoMDCZhJdwIyCf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Customized Dot size](./images/Blazor-custom-dot-size.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNhoMDCZhJdwIyCf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Customized Dot size](./images/Blazor-custom-dot-size.png)" %} ### Dot Shadow @@ -300,9 +292,7 @@ Add shadow effects to Timeline dots for visual engagement using the `--dot-outer ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDrIsDWZVzchTIyz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Customized Dot shadow](./images/Blazor-custom-dot-shadow.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDrIsDWZVzchTIyz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Customized Dot shadow](./images/Blazor-custom-dot-shadow.png)" %} ### Dot Variant @@ -378,9 +368,7 @@ Achieve desired dot variants by customizing the border, outline, and background ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDBIMjWjrJQutWVB?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Customized Dot variant](./images/Blazor-custom-dot-variant.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDBIMjWjrJQutWVB?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Customized Dot variant](./images/Blazor-custom-dot-variant.png)" %} ### Dot Outline @@ -428,6 +416,4 @@ Adding the `e-outline` class to the Timeline's [`CssClass`](https://help.syncfus ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VjryCZitBflzyNaY?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Customized Dot outline](./images/Blazor-custom-dot-outline.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjryCZitBflzyNaY?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Customized Dot outline](./images/Blazor-custom-dot-outline.png)" %} diff --git a/blazor/timeline/items.md b/blazor/timeline/items.md index 821e4a59e3..cc78b8dabf 100644 --- a/blazor/timeline/items.md +++ b/blazor/timeline/items.md @@ -52,9 +52,7 @@ Define string content for the Timeline items. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VDhoiXitLINuEmVQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with String Content](./images/Blazor-content-string.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VDhoiXitLINuEmVQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with String Content](./images/Blazor-content-string.png)" %} ### Template Content @@ -148,9 +146,7 @@ Specify template content for items within the [`Content`](https://help.syncfusio ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVoiZWNBIsugdwp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Template Content](./images/Blazor-content-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVoiZWNBIsugdwp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Template Content](./images/Blazor-content-template.png)" %} ## Adding Opposite Content @@ -193,9 +189,7 @@ Additional information can be added to each Timeline item using the [`OppositeCo } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhesNCtVIBdFQVq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Opposite Content](./images/Blazor-oppositecontent.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhesNCtVIBdFQVq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Opposite Content](./images/Blazor-oppositecontent.png)" %} ## Dot Item @@ -301,9 +295,7 @@ Use the [`Disabled`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Lay ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BXVSiXsNrenzQvuQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Disabled Item](./images/Blazor-disabled.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXVSiXsNrenzQvuQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Disabled Item](./images/Blazor-disabled.png)" %} ## CSS Class diff --git a/blazor/timeline/orientations.md b/blazor/timeline/orientations.md index d82af1736a..b2e46f89fa 100644 --- a/blazor/timeline/orientations.md +++ b/blazor/timeline/orientations.md @@ -55,9 +55,7 @@ Display items vertically by setting the [`Orientation`](https://help.syncfusion. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rjrICNiXVyQMOUAm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Vertical Orientation](./images/Blazor-orientation-vertical.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rjrICNiXVyQMOUAm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Vertical Orientation](./images/Blazor-orientation-vertical.png)" %} ## Horizontal @@ -101,6 +99,4 @@ In horizontal orientation, items are displayed side-by-side by setting the [`Ori ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVyMjsZheQuYAQE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Horizontal Orientation](./images/Blazor-orientation-horizontal.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVyMjsZheQuYAQE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Horizontal Orientation](./images/Blazor-orientation-horizontal.png)" %} diff --git a/blazor/timeline/reverse.md b/blazor/timeline/reverse.md index 6b87ae39c4..78019dde71 100644 --- a/blazor/timeline/reverse.md +++ b/blazor/timeline/reverse.md @@ -42,6 +42,4 @@ The `Reverse` property reverses the order of the Timeline items as defined in th ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVoMXMZryaiFxsB?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Common Customized Connector](./images/Blazor-reverse.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVoMXMZryaiFxsB?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Common Customized Connector](./images/Blazor-reverse.png)" %} \ No newline at end of file diff --git a/blazor/timeline/template.md b/blazor/timeline/template.md index 84c60d3daa..185adec891 100644 --- a/blazor/timeline/template.md +++ b/blazor/timeline/template.md @@ -169,6 +169,4 @@ The `Template` context receives the following information: } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBIitWNVdDBCoBz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Timeline Component with Template](./images/Blazor-template.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBIitWNVdDBCoBz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Timeline Component with Template](./images/Blazor-template.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/align-items-using-spacer.md b/blazor/toolbar/align-items-using-spacer.md index f56e1ff1d0..ac03052f3e 100644 --- a/blazor/toolbar/align-items-using-spacer.md +++ b/blazor/toolbar/align-items-using-spacer.md @@ -34,9 +34,7 @@ Insert spacers at the end of the items on the left and in the center. This will ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VNLSMZiXfjMHImXT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-left-right-center-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VNLSMZiXfjMHImXT?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-left-right-center-item.png)" %} ## Left and Right alignment @@ -58,9 +56,7 @@ Insert a spacer between items intended for left and right alignment. This pushes ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDhyCjCNpZsakxAz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-left-right-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDhyCjCNpZsakxAz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-left-right-item.png)" %} ## Right alignment @@ -82,9 +78,7 @@ Insert a spacer as the first item in the toolbar. This pushes all other items to ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDLesXsXJthASXEy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-right-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDLesXsXJthASXEy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Spacer](./images/blazor-toolbar-spacer-right-item.png)" %} N> Avoid using the `Align` property in toolbar items when `Spacer` is utilized. \ No newline at end of file diff --git a/blazor/toolbar/how-to/add-remove-toolbar-items.md b/blazor/toolbar/how-to/add-remove-toolbar-items.md index aac3c18bce..15ab9e80b1 100644 --- a/blazor/toolbar/how-to/add-remove-toolbar-items.md +++ b/blazor/toolbar/how-to/add-remove-toolbar-items.md @@ -91,6 +91,4 @@ In the following demo, the `ToolbarItems` collection initially contains five ite } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDheWZitquTDHMDs?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Adding or Removing Blazor Toolbar Items](../images/blazor-toolbar-add-or-remove-item.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDheWZitquTDHMDs?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Adding or Removing Blazor Toolbar Items](../images/blazor-toolbar-add-or-remove-item.gif)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/add-toggle-button.md b/blazor/toolbar/how-to/add-toggle-button.md index a770fe2dad..aebfdea8a1 100644 --- a/blazor/toolbar/how-to/add-toggle-button.md +++ b/blazor/toolbar/how-to/add-toggle-button.md @@ -202,6 +202,4 @@ On clicking the toggle Button, change the required icon and content based on cur } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNLSWXsZqaepVhRz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Toggle Button](../images/blazor-toolbar-item-with-toggle-button.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNLSWXsZqaepVhRz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Toggle Button](../images/blazor-toolbar-item-with-toggle-button.gif)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/customize-the-scrolling-distance.md b/blazor/toolbar/how-to/customize-the-scrolling-distance.md index 3fb8d833c0..6c3437327d 100644 --- a/blazor/toolbar/how-to/customize-the-scrolling-distance.md +++ b/blazor/toolbar/how-to/customize-the-scrolling-distance.md @@ -50,6 +50,4 @@ The toolbar `ScrollStep` property supports to customize the scrolling distance, ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZryMZCNAknqZPUj?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Custominzing Scroll Step in Blazor Toolbar](../images/blazor-toolbar-scrollstep.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZryMZCNAknqZPUj?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Custominzing Scroll Step in Blazor Toolbar](../images/blazor-toolbar-scrollstep.gif)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/enable-or-disable-toolbar-item.md b/blazor/toolbar/how-to/enable-or-disable-toolbar-item.md index a8e8b6672f..b3b323d339 100644 --- a/blazor/toolbar/how-to/enable-or-disable-toolbar-item.md +++ b/blazor/toolbar/how-to/enable-or-disable-toolbar-item.md @@ -39,6 +39,4 @@ The `Disabled` property of a Toolbar item enables or disables the item by settin } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VtrIMDCZUEcssLph?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Enabling or Disabling Blazor Toolbar Item](../images/blazor-toolbar-disable-item.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtrIMDCZUEcssLph?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Enabling or Disabling Blazor Toolbar Item](../images/blazor-toolbar-disable-item.gif)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/set-command-customization.md b/blazor/toolbar/how-to/set-command-customization.md index 4cd9d0234b..7071e57629 100644 --- a/blazor/toolbar/how-to/set-command-customization.md +++ b/blazor/toolbar/how-to/set-command-customization.md @@ -49,6 +49,4 @@ Single or multiple CSS classes can be applied to Toolbar items using the `Toolba ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rZLeWXiDguQHpcdp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar with Custom Items](../images/blazor-toolbar-custom-command.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/rZLeWXiDguQHpcdp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar with Custom Items](../images/blazor-toolbar-custom-command.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/set-item-wise-custom-template.md b/blazor/toolbar/how-to/set-item-wise-custom-template.md index 834d2d0009..bb531ea190 100644 --- a/blazor/toolbar/how-to/set-item-wise-custom-template.md +++ b/blazor/toolbar/how-to/set-item-wise-custom-template.md @@ -39,6 +39,4 @@ The Toolbar supports defining custom content for an item using its `Template` pr ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VNBeCZWZqOFgmHpq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Custom Template](../images/blazor-toolbar-item-custom-template.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/VNBeCZWZqOFgmHpq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Custom Template](../images/blazor-toolbar-item-custom-template.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/set-tool-tip-to-the-commands.md b/blazor/toolbar/how-to/set-tool-tip-to-the-commands.md index 59bd5c08c1..12535c3cec 100644 --- a/blazor/toolbar/how-to/set-tool-tip-to-the-commands.md +++ b/blazor/toolbar/how-to/set-tool-tip-to-the-commands.md @@ -32,6 +32,4 @@ Initialize the Tooltip with the Toolbar target. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VjBIsZMNAavbcYAH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar with Tooltip](../images/blazor-toolbar-with-tooltip.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjBIsZMNAavbcYAH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar with Tooltip](../images/blazor-toolbar-with-tooltip.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/show-hide-toolbar-item.md b/blazor/toolbar/how-to/show-hide-toolbar-item.md index dbb663bea1..42051367dc 100644 --- a/blazor/toolbar/how-to/show-hide-toolbar-item.md +++ b/blazor/toolbar/how-to/show-hide-toolbar-item.md @@ -40,6 +40,4 @@ The `Visible` property of a Toolbar item controls its visibility by setting its } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDhSsXCXqYOTHppI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Showing or Hiding Blazor Toolbar Items](../images/blazor-toolbar-show-or-hide-item.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDhSsXCXqYOTHppI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Showing or Hiding Blazor Toolbar Items](../images/blazor-toolbar-show-or-hide-item.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/how-to/tab-key-navigation-toolbar-items.md b/blazor/toolbar/how-to/tab-key-navigation-toolbar-items.md index d0ad401b2f..0df64e7523 100644 --- a/blazor/toolbar/how-to/tab-key-navigation-toolbar-items.md +++ b/blazor/toolbar/how-to/tab-key-navigation-toolbar-items.md @@ -66,6 +66,4 @@ If [TabIndex](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigation ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LjLSWXCDJtDTYouf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar with TabIndex](../images/blazor-toolbar-item-tabindex.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LjLSWXCDJtDTYouf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar with TabIndex](../images/blazor-toolbar-item-tabindex.gif)" %} \ No newline at end of file diff --git a/blazor/toolbar/item-configuration.md b/blazor/toolbar/item-configuration.md index cce24dd449..474bd676d5 100644 --- a/blazor/toolbar/item-configuration.md +++ b/blazor/toolbar/item-configuration.md @@ -52,9 +52,7 @@ This property specifies the alignment of Toolbar items within the Toolbar. Each ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXLyCNCXftRpJLCM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Aligning Blazor Toolbar Item](./images/blazor-toolbar-align-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXLyCNCXftRpJLCM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Aligning Blazor Toolbar Item](./images/blazor-toolbar-align-item.png)" %} To optimize the alignment of Toolbar items without using [Align](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.ToolbarItem.html#Syncfusion_Blazor_Navigations_ToolbarItem_Align) property, utilize the [Spacer](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.ToolbarItem.html#Syncfusion_Blazor_Navigations_ToolbarItem_Type) in toolbar. Refer [here](./align-items.md) to integrate spacer in Toolbar. @@ -89,9 +87,7 @@ This property specifies a unique ID to be used for the button or input element o ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjhIMDstpjPGdSjE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Id](./images/blazor-toolbar-align-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjhIMDstpjPGdSjE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Id](./images/blazor-toolbar-align-item.png)" %} ## Overflow @@ -137,9 +133,7 @@ It defines the priority of items to display it in popup always. It allows to mai ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVoMXWtJZEVZkAZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Displaying Blazor Toolbar Item in Popup](./images/blazor-toolbar-item-in-popup.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VjVoMXWtJZEVZkAZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Displaying Blazor Toolbar Item in Popup](./images/blazor-toolbar-item-in-popup.png)" %} ## ShowTextOn @@ -190,9 +184,7 @@ This property defines single or multiple classes, separated by space, used to sp ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNVoMZsjpDEcZVJO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar displays Icon in Suffix Item](./images/blazor-toolbar-icon-in-suffix-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNVoMZsjpDEcZVJO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar displays Icon in Suffix Item](./images/blazor-toolbar-icon-in-suffix-item.png)" %} N> Refer [here](https://blazor.syncfusion.com/documentation/appearance/icons#icon-integration-in-button-component) to integrate Syncfusion icons in the Toolbar component. @@ -231,9 +223,7 @@ It is used to specify the text to be displayed on hovering the Toolbar button. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhSMDWXzWXgSuJH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Tooltip](./images/blazor-toolbar-item-tooltip.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhSMDWXzWXgSuJH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Tooltip](./images/blazor-toolbar-item-tooltip.png)" %} ## Type @@ -284,9 +274,7 @@ The `Separator` type adds a vertical line that visually separates Toolbar's item N> If `Separator` is added as the first or the last item, it will not be visible. -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVyWXstpsZPnxkf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Separator](./images/blazor-toolbar-item-separator.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDVyWXstpsZPnxkf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Separator](./images/blazor-toolbar-item-separator.png)" %} ### Input @@ -389,9 +377,7 @@ The following code explains how to add `NumericTextBox`, `DropDownList`, `RadioB } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VNLeCNitzsCzoltu?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Other Components](./images/blazor-toolbar-item-with-other-components.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VNLeCNitzsCzoltu?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Other Components](./images/blazor-toolbar-item-with-other-components.png)" %} ### Spacer @@ -419,9 +405,7 @@ It specifies whether an item should be hidden or not. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LjhSWDCDJWCPTNhF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Hiding Blazor Toolbar Item](./images/blazor-toolbar-hidden-item.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LjhSWDCDJWCPTNhF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Hiding Blazor Toolbar Item](./images/blazor-toolbar-hidden-item.png)" %} ## Width @@ -445,6 +429,4 @@ It specifies the width of the Toolbar button Items. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhSMZWXzWVqDebF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Custom Width](./images/blazor-toolbar-item-custom-width.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhSMZWXzWVqDebF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Custom Width](./images/blazor-toolbar-item-custom-width.png)" %} \ No newline at end of file diff --git a/blazor/toolbar/responsive-mode.md b/blazor/toolbar/responsive-mode.md index 7e32e1fe05..4c79f2153d 100644 --- a/blazor/toolbar/responsive-mode.md +++ b/blazor/toolbar/responsive-mode.md @@ -67,9 +67,7 @@ The default [`OverflowMode`](https://help.syncfusion.com/cr/blazor/Syncfusion.Bl ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhoitCZzVqTpUBZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Scrolling in Blazor Toolbar](./images/blazor-toolbar-scrolling.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VXhoitCZzVqTpUBZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Scrolling in Blazor Toolbar](./images/blazor-toolbar-scrolling.png)" %} ## Popup @@ -102,9 +100,7 @@ N> If the popup content exceeds the height of the page, overflowing items will n ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BNVoijsXzLKbvuYU?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item in Popup Mode](./images/blazor-toolbar-item-popup-mode.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNVoijsXzLKbvuYU?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item in Popup Mode](./images/blazor-toolbar-item-popup-mode.png)" %} ### Priority of Items @@ -160,9 +156,7 @@ In the following code sample, text is only visible in the popup container and no ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hZLeCXijTVTcokhS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Displaying Blazor Toolbar Item in Overflow](./images/blazor-toolbar-item-in-overflow.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hZLeCXijTVTcokhS?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Displaying Blazor Toolbar Item in Overflow](./images/blazor-toolbar-item-in-overflow.png)" %} ## MultiRow @@ -190,9 +184,7 @@ In the following code sample, text is only visible in the popup container and no ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/htLSijMXTVoswbPi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with MultiRow](./images/blazor-toolbar-item-with-multirow.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/htLSijMXTVoswbPi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with MultiRow](./images/blazor-toolbar-item-with-multirow.png)" %} ## Extended @@ -219,6 +211,4 @@ In the following code sample, text is only visible in the popup container and no ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNroCNiZJhSGdfxr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor Toolbar Item with Extended Mode](./images/blazor-toolbar-item-extended-mode.gif) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNroCNiZJhSGdfxr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Toolbar Item with Extended Mode](./images/blazor-toolbar-item-extended-mode.gif)" %} \ No newline at end of file diff --git a/blazor/treegrid/getting-started-webapp.md b/blazor/treegrid/getting-started-webapp.md index b9db0c60a4..9c71aff12c 100644 --- a/blazor/treegrid/getting-started-webapp.md +++ b/blazor/treegrid/getting-started-webapp.md @@ -282,7 +282,7 @@ N> If an **Interactivity Location** is set to `Global` and the **Render Mode** i * Press Ctrl+F5 (Windows) or +F5 (macOS) to launch the application. This will render the Syncfusion® Blazor TreeGrid component in your default web browser. -{% previewsample alt="Blazor TreeGrid Getting Started Sample" "https://blazorplayground.syncfusion.com/embed/BNLzXiANJxYypVIp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeGrid](images/blazor-treegrid-component.png)" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/BNLzXiANJxYypVIp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeGrid](images/blazor-treegrid-component.png)" %} N> [View Sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/TreeGrid/BlazorWebApp). @@ -441,7 +441,7 @@ The sorting feature enables to order the records. It can be enabled by setting t {% endhighlight %} {% endtabs %} -{% previewsample alt="Blazor TreeGrid Paging and Sorting Sample" "https://blazorplayground.syncfusion.com/embed/rtLzNMKDzGDJVWCD?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeGrid](images/blazor-treegrid.png)" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/rtLzNMKDzGDJVWCD?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeGrid](images/blazor-treegrid.png)" %} ## Handling exceptions @@ -531,7 +531,7 @@ The following code example shows how to use the [OnActionFailure](https://help.s {% endhighlight %} {% endtabs %} -{% previewsample alt="Blazor TreeGrid Exception Handling Sample" "https://blazorplayground.syncfusion.com/embed/BXBIMtXaTweQwBMx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXBIMtXaTweQwBMx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} ## See also diff --git a/blazor/treeview/check-box.md b/blazor/treeview/check-box.md index 9bc3f1cc59..d670bbc655 100644 --- a/blazor/treeview/check-box.md +++ b/blazor/treeview/check-box.md @@ -101,9 +101,7 @@ For independent checked states, allowing child nodes to be checked or unchecked } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LNhSitCBUvmzMcKy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with CheckBox](./images/blazor-treeview-checkbox.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LNhSitCBUvmzMcKy?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with CheckBox](./images/blazor-treeview-checkbox.png)" %} ## Check Nodes through Data Binding @@ -277,9 +275,7 @@ The Blazor TreeView component enables checking specific nodes upon initial rende } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBSMZsVqvvPrMXI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView](./images/checkednodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBSMZsVqvvPrMXI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView](./images/checkednodes.png)" %} ## Check and Uncheck All Nodes @@ -384,9 +380,7 @@ The example demonstrates the usage of these methods within the context of a butt } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LtrICXiVgusUIOKg?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView](./images/check-uncheck.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LtrICXiVgusUIOKg?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView](./images/check-uncheck.png)" %} ## Get Checked Nodes @@ -541,9 +535,7 @@ The Blazor TreeView component provides the capability to pre-select specific nod ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hXVyCtMrKkBdTNdz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Get checked nodes](./images/blazor-treeview-get-checked-nodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hXVyCtMrKkBdTNdz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Get checked nodes](./images/blazor-treeview-get-checked-nodes.png)" %} ## Single Selection with CheckBox @@ -748,9 +740,7 @@ The Blazor TreeView component can render checkboxes before each node when [`Show ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/htLosZWBgaTqlQtr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Hide CheckBox for parent nodes](./images/blazor-treeview-remove-parent-checkbox.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/htLosZWBgaTqlQtr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Hide CheckBox for parent nodes](./images/blazor-treeview-remove-parent-checkbox.png)" %} ## Cancel the Check Action diff --git a/blazor/treeview/data-binding.md b/blazor/treeview/data-binding.md index bd0e48209d..ff84ea6e18 100644 --- a/blazor/treeview/data-binding.md +++ b/blazor/treeview/data-binding.md @@ -120,9 +120,7 @@ In the following example, **Id**, **FolderName**, and **SubFolders** columns fro ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBSMtsVUEylUdFX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Hierarchical Data](./images/blazor-treeview-hierarchical-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXBSMtsVUEylUdFX?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Hierarchical Data](./images/blazor-treeview-hierarchical-data.png)" %} N> In the Blazor TreeView component, observable collection support is provided only for the [`DataSource`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.TreeViewFieldOptions-1.html#Syncfusion_Blazor_Navigations_TreeViewFieldOptions_1_DataSource) property, not for the [`Child`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.TreeViewFieldOptions-1.html#Syncfusion_Blazor_Navigations_TreeViewFieldOptions_1_Child) property. The [`Child`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.TreeViewFieldOptions-1.html#Syncfusion_Blazor_Navigations_TreeViewFieldOptions_1_Child) property supports only the `List` data type. @@ -219,9 +217,7 @@ To render the root level nodes, specify the ParentID as null or no need to speci ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDroWNWBAucDwMeI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Self-Referential Data](./images/blazor-treeview-hierarchical-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDroWNWBAucDwMeI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Self-Referential Data](./images/blazor-treeview-hierarchical-data.png)" %} ### ExpandoObject Binding @@ -441,9 +437,7 @@ The **OrderID**, **EmployeeID**, and **ShipName** columns from orders table are } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjByWXirTXWroCXq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Remote Data](./images/blazor-treeview-remote-data.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjByWXirTXWroCXq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Remote Data](./images/blazor-treeview-remote-data.png)" %} ### Web API Adaptor diff --git a/blazor/treeview/drag-and-drop.md b/blazor/treeview/drag-and-drop.md index 7b3bc5216c..11e8c764a1 100644 --- a/blazor/treeview/drag-and-drop.md +++ b/blazor/treeview/drag-and-drop.md @@ -113,9 +113,7 @@ N> In the [**OnNodeDragged**](https://help.syncfusion.com/cr/blazor/Syncfusion.B ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VNhyMZsBJDLnhwpw?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Drag and Drop Node in Blazor TreeView](./images/blazor-treeview-drag-drop-node.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VNhyMZsBJDLnhwpw?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Drag and Drop Node in Blazor TreeView](./images/blazor-treeview-drag-drop-node.png)" %} ## Multiple-Node Drag and Drop @@ -208,9 +206,7 @@ To enable dragging and dropping of multiple nodes, enable both the [`AllowMultiS } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhSsXsVfZUjOzRj?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Drag and Drop Multiple Node in Blazor TreeView](./images/blazor-treeview-drag-drop-multi-node.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hNhSsXsVfZUjOzRj?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Drag and Drop Multiple Node in Blazor TreeView](./images/blazor-treeview-drag-drop-multi-node.png)" %} ## Drag and Drop within a TreeView @@ -277,9 +273,7 @@ The default value of `AllowDragAndDrop` property is false. } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BXLyitsLTjUePIsG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Drag and drop within a TreeView](./images/blazor-treeview-drag-and-drop-within-treeview.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXLyitsLTjUePIsG?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Drag and drop within a TreeView](./images/blazor-treeview-drag-and-drop-within-treeview.png)" %} ## Drag and Drop Between TreeViews @@ -493,9 +487,7 @@ The Blazor TreeView component includes built-in drag and drop support, allowing ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZryiDsBftpsSWPi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Drag and drop between TreeViews](./images/blazor-treeview-drag-and-drop-between-treeviews.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZryiDsBftpsSWPi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Drag and drop between TreeViews](./images/blazor-treeview-drag-and-drop-between-treeviews.png)" %} ## Restrict Drag and Drop for Individual node diff --git a/blazor/treeview/expand-collaspe-actions.md b/blazor/treeview/expand-collaspe-actions.md index ad6e3dcccb..ff94d33100 100644 --- a/blazor/treeview/expand-collaspe-actions.md +++ b/blazor/treeview/expand-collaspe-actions.md @@ -95,9 +95,7 @@ Specific nodes can be programmatically expanded upon TreeView initialization by } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rjhSWNCrTNHHeZFa?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Expand nodes through data binding](./images/blazor-treeview-expand-nodes-through-data-binding.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rjhSWNCrTNHHeZFa?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Expand nodes through data binding](./images/blazor-treeview-expand-nodes-through-data-binding.png)" %} ## Expand Nodes through API @@ -336,9 +334,7 @@ The Blazor TreeView component provides the `ExpandedNodes` property for two-way } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDLSMDCVfjcEkxgQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Get expanded nodes](./images/blazor-treeview-get-expanded-nodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDLSMDCVfjcEkxgQ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Get expanded nodes](./images/blazor-treeview-get-expanded-nodes.png)" %} ## Expand or Collapse a Node Programmatically diff --git a/blazor/treeview/how-to/accordion-tree.md b/blazor/treeview/how-to/accordion-tree.md index 675366aa9b..a6c06180d5 100644 --- a/blazor/treeview/how-to/accordion-tree.md +++ b/blazor/treeview/how-to/accordion-tree.md @@ -214,6 +214,4 @@ An accordion is a UI pattern where a list of items allows one item to be expande ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hZhoMjCBqcFBIQiH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Customizing Blazor TreeView as Accordion](../images/blazor-treeview-with-custom-accordion.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/hZhoMjCBqcFBIQiH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Blazor TreeView as Accordion](../images/blazor-treeview-with-custom-accordion.png)" %} \ No newline at end of file diff --git a/blazor/treeview/how-to/check-uncheck-the-checkbox-on-clicking-the-tree-node-text.md b/blazor/treeview/how-to/check-uncheck-the-checkbox-on-clicking-the-tree-node-text.md index 3d6b63b665..d92069f21a 100644 --- a/blazor/treeview/how-to/check-uncheck-the-checkbox-on-clicking-the-tree-node-text.md +++ b/blazor/treeview/how-to/check-uncheck-the-checkbox-on-clicking-the-tree-node-text.md @@ -190,6 +190,4 @@ Checkboxes in the TreeView can be checked and unchecked by clicking the tree nod } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLesXsrAwEkrazW?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Checking or Unchecking CheckBox in Blazor TreeView](../images/blazor-treeview-checkbox.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtLesXsrAwEkrazW?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Checking or Unchecking CheckBox in Blazor TreeView](../images/blazor-treeview-checkbox.png)" %} \ No newline at end of file diff --git a/blazor/treeview/how-to/customize-the-expand-and-collapse-icons.md b/blazor/treeview/how-to/customize-the-expand-and-collapse-icons.md index f1bf0b1d9f..00eb545bd5 100644 --- a/blazor/treeview/how-to/customize-the-expand-and-collapse-icons.md +++ b/blazor/treeview/how-to/customize-the-expand-and-collapse-icons.md @@ -139,9 +139,7 @@ The following example demonstrates how to customize the expand and collapse icon ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhSsjMrKbjcuFLi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Customizing Expand and Collapse Icon in Blazor TreeView](../images/blazor-treeview-customize-expand-collapse-icon.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rXhSsjMrKbjcuFLi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Expand and Collapse Icon in Blazor TreeView](../images/blazor-treeview-customize-expand-collapse-icon.png)" %} ## Customize Expand/Collapse Icon Position and Color @@ -340,9 +338,7 @@ The position and color of the expand or collapse icons are customized using CSS. ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDBIMDMrKbiQKRCm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Customizing Icon Position and Color in Blazor TreeView](../images/blazor-treeview-custom-icons-position-and-color.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDBIMDMrKbiQKRCm?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Icon Position and Color in Blazor TreeView](../images/blazor-treeview-custom-icons-position-and-color.png)" %} ## Increase Padding Between Text, Expand/Collapse Icons, and Custom Icons diff --git a/blazor/treeview/how-to/customize-the-tree-nodes-based-on-levels.md b/blazor/treeview/how-to/customize-the-tree-nodes-based-on-levels.md index 448a0a7386..b687c1f05a 100644 --- a/blazor/treeview/how-to/customize-the-tree-nodes-based-on-levels.md +++ b/blazor/treeview/how-to/customize-the-tree-nodes-based-on-levels.md @@ -139,6 +139,4 @@ The following example demonstrates customizing node appearance at various levels ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BXhIWNihKvBuqmZc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Customizing Nodes based on Levels in Blazor TreeView](../images/blazor-treeview-with-custom-nodes.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXhIWNihKvBuqmZc?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Customizing Nodes based on Levels in Blazor TreeView](../images/blazor-treeview-with-custom-nodes.png)" %} \ No newline at end of file diff --git a/blazor/treeview/how-to/get-dynamic-icon.md b/blazor/treeview/how-to/get-dynamic-icon.md index ceae582125..8c9694af60 100644 --- a/blazor/treeview/how-to/get-dynamic-icon.md +++ b/blazor/treeview/how-to/get-dynamic-icon.md @@ -98,6 +98,4 @@ bound `IconCss` class dynamically. Using the [`GetTreeData`](https://help.syncfu ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZryMNCBAPAkNGNK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Dynamic Icon](../images/blazor-treeview-dynamic-icon.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZryMNCBAPAkNGNK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Dynamic Icon](../images/blazor-treeview-dynamic-icon.png)" %} \ No newline at end of file diff --git a/blazor/treeview/how-to/validate-the-text-when-renaming-the-tree-node.md b/blazor/treeview/how-to/validate-the-text-when-renaming-the-tree-node.md index 407267c7ac..23371d3d0b 100644 --- a/blazor/treeview/how-to/validate-the-text-when-renaming-the-tree-node.md +++ b/blazor/treeview/how-to/validate-the-text-when-renaming-the-tree-node.md @@ -120,6 +120,4 @@ Node text is validated during the editing process using the [`NodeEdited`](https ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LDresjCVKbokLFvR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Renaming Tree Node in Blazor TreeView](../images/blazor-treeview-rename-tree-node.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDresjCVKbokLFvR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Renaming Tree Node in Blazor TreeView](../images/blazor-treeview-rename-tree-node.png)" %} \ No newline at end of file diff --git a/blazor/treeview/integration.md b/blazor/treeview/integration.md index bcc7010775..9b850f554f 100644 --- a/blazor/treeview/integration.md +++ b/blazor/treeview/integration.md @@ -248,8 +248,7 @@ This is demonstrated in an example where the TreeView operations are manipulated } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZheMDMKCfviYktD?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Context Menu in Blazor TreeView Component](./images/blazor-treeview-node-with-context-menu.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZheMDMKCfviYktD?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Context Menu in Blazor TreeView Component](./images/blazor-treeview-node-with-context-menu.png)" %} ## Badge Integration @@ -414,8 +413,7 @@ The Blazor TreeView component integrates with the Syncfusion Badge component, en ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hXreitsqiTbQmSBM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Badge integration in Blazor TreeView](./images/blazor-treeview-badge-integration.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hXreitsqiTbQmSBM?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Badge integration in Blazor TreeView](./images/blazor-treeview-badge-integration.png)" %} ## Icons Library Integration @@ -572,8 +570,7 @@ The Blazor TreeView component has the built-in option to customize each node's a ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBIWZsKWoisIIxY?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Icons integration in Blazor TreeView](./images/blazor-treeview-Icon-integration.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBIWZsKWoisIIxY?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Icons integration in Blazor TreeView](./images/blazor-treeview-Icon-integration.png)" %} ## Navigation within Sidebar diff --git a/blazor/treeview/multiple-selection.md b/blazor/treeview/multiple-selection.md index 4c36338362..46df9fb83f 100644 --- a/blazor/treeview/multiple-selection.md +++ b/blazor/treeview/multiple-selection.md @@ -109,6 +109,4 @@ N> Multi selection is not applicable through touch interactions. } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LthICXWgCerHXKMx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![MultiSelection in Blazor TreeView](./images/multiselect.png) \ No newline at end of file +{% previewsample "https://blazorplayground.syncfusion.com/embed/LthICXWgCerHXKMx?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[MultiSelection in Blazor TreeView](./images/multiselect.png)" %} \ No newline at end of file diff --git a/blazor/treeview/node-customization.md b/blazor/treeview/node-customization.md index 13fc50ad10..999007fb4d 100644 --- a/blazor/treeview/node-customization.md +++ b/blazor/treeview/node-customization.md @@ -613,8 +613,7 @@ The TreeView component provides a straightforward way to enable tooltips for tre } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXVIsDigMkgFfzRJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![ToolTip in Blazor TreeView](./images/tooltip.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXVIsDigMkgFfzRJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[ToolTip in Blazor TreeView](./images/tooltip.png)" %} ## Customize Nodes Tooltip in Blazor TreeView Component @@ -776,8 +775,7 @@ While native tooltip elements might offer limited customization, the Blazor Tool ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZLyMNMqsOQjSsJn?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![ToolTip Template in Blazor TreeView](./images/tooltip-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VZLyMNMqsOQjSsJn?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[ToolTip Template in Blazor TreeView](./images/tooltip-template.png)" %} ## Get all Nodes in Blazor TreeView Component diff --git a/blazor/treeview/node-editing.md b/blazor/treeview/node-editing.md index 23ccab0a35..370c0a243c 100644 --- a/blazor/treeview/node-editing.md +++ b/blazor/treeview/node-editing.md @@ -124,9 +124,7 @@ When editing is completed by focusing out or by pressing the Enter ke } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjByiDWqMuupOrPJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Node Editing in Blazor TreeView](./images/blazor-treeview-node-editing.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjByiDWqMuupOrPJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Node Editing in Blazor TreeView](./images/blazor-treeview-node-editing.png)" %} ## CRUD Operations @@ -377,9 +375,7 @@ The example provided demonstrates how to use the `ItemSelected` event of the con } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVyMtMKLDjzDfze?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![CRUD operation using list in Blazor TreeView](./images/blazor-treeview-node-with-context-menu.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVyMtMKLDjzDfze?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[CRUD operation using list in Blazor TreeView](./images/blazor-treeview-node-with-context-menu.png)" %} ### Add or Remove Node Programmatically @@ -583,8 +579,7 @@ The Blazor TreeView component allows for the dynamic addition or removal of spec } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LZLeWtCULXCrLgvq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Add or Remove node in Blazor TreeView](./images/add-remove-node.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LZLeWtCULXCrLgvq?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Add or Remove node in Blazor TreeView](./images/add-remove-node.png)" %} ### Add or Remove Node Programmatically with Template @@ -798,8 +793,7 @@ The Blazor TreeView component with template support also allows for the dynamic ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVyWXCUrtVeSfmL?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Blazor TreeView](./images/template-add-remove-node.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVyWXCUrtVeSfmL?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView](./images/template-add-remove-node.png)" %} ### Add Node through Popup @@ -1189,8 +1183,7 @@ The Blazor TreeView component enables dynamic editing of specific nodes. This ca } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hXhoCtCgrNyGxtWK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Edit node in Blazor TreeView](./images/edit-node.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hXhoCtCgrNyGxtWK?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Edit node in Blazor TreeView](./images/edit-node.png)" %} ### Edit a Node with Template diff --git a/blazor/treeview/node-selection.md b/blazor/treeview/node-selection.md index 9f762b7fdf..6dddb6714a 100644 --- a/blazor/treeview/node-selection.md +++ b/blazor/treeview/node-selection.md @@ -102,9 +102,7 @@ The Blazor TreeView component enables the selection of specific nodes during ini } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/VthIWNWKhiiVUngi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Select nodes through data binding](./images/data-binding.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/VthIWNWKhiiVUngi?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Select nodes through data binding](./images/data-binding.png)" %} ## Select Nodes through API @@ -193,8 +191,7 @@ The Blazor TreeView component provides the capability to select specific nodes d } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDVysDiALMMnYUXd?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Select nodes through API](./images/data-binding.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDVysDiALMMnYUXd?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Select nodes through API](./images/data-binding.png)" %} ## Select all Nodes Programmatically @@ -304,9 +301,7 @@ Here, selected all TreeView parent nodes by clicking a button. If the nodes have } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BtByCjMABihnMnxr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Parent nodes](./images/blazor-treeview-parent-node-selection.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BtByCjMABihnMnxr?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Parent nodes](./images/blazor-treeview-parent-node-selection.png)" %} ### Child Nodes @@ -412,9 +407,7 @@ To select only child nodes in the TreeView, retrieve all nodes and add the IDs o } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/hjLIMjCUrigsqVBH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Child nodes](./images/child-nodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/hjLIMjCUrigsqVBH?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Child nodes](./images/child-nodes.png)" %} ## Get Selected Nodes @@ -570,9 +563,7 @@ The Blazor TreeView component provides the capability to select specific nodes d ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rjVyCZsALsQJGdJR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Get selected nodes](./images/blazor-treeview-get-selected-nodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rjVyCZsALsQJGdJR?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Get selected nodes](./images/blazor-treeview-get-selected-nodes.png)" %} ## Select all nodes on load @@ -674,8 +665,7 @@ In the Blazor TreeView component, you can select all TreeView nodes on initial r } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LNVSCtsqhCFWilwv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Select all nodes on load](./images/select-allnode.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LNVSCtsqhCFWilwv?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Select all nodes on load](./images/select-allnode.png)" %} ## Select all Nodes Programmatically @@ -779,8 +769,7 @@ To select all TreeView nodes on initial rendering, utilize the TreeView componen ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLesjiUBBWsNrVU?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -![Select all nodes programmatically](./images/select-allnode.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BDLesjiUBBWsNrVU?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Select all nodes programmatically](./images/select-allnode.png)" %} ## Select Individual Node Programmatically @@ -875,9 +864,7 @@ To select a specific TreeView node programmatically, use a button click or other } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BXBoWXiAhhWdEIWA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Select individual node programmatically](./images/blazor-treeview-select-individual-node-programmatically.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXBoWXiAhhWdEIWA?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Select individual node programmatically](./images/blazor-treeview-select-individual-node-programmatically.png)" %} ## Retrieve Indices of Selected Nodes @@ -1048,9 +1035,7 @@ In the Blazor TreeView component, you can display the index value of selected Tr } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXLysNiqrLVLrOLk?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Retrieve indices of selected nodes](./images/blazor-treeview-retrieve-indices-of-selected-nodes.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXLysNiqrLVLrOLk?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Retrieve indices of selected nodes](./images/blazor-treeview-retrieve-indices-of-selected-nodes.png)" %} ## Disable Full Row Selection diff --git a/blazor/treeview/searching-and-filtering.md b/blazor/treeview/searching-and-filtering.md index bc402acec2..a74559c0f1 100644 --- a/blazor/treeview/searching-and-filtering.md +++ b/blazor/treeview/searching-and-filtering.md @@ -299,6 +299,4 @@ The Blazor TreeView component supports filtering its nodes through an external i ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/rDrIsXMKhVJFHvwP?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Searching and Filtering in Blazor TreeView Component](./images/blazor-treeview-searching-and-filtering.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/rDrIsXMKhVJFHvwP?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Searching and Filtering in Blazor TreeView Component](./images/blazor-treeview-searching-and-filtering.png)" %} diff --git a/blazor/treeview/template.md b/blazor/treeview/template.md index b9760caf00..b319caa304 100644 --- a/blazor/treeview/template.md +++ b/blazor/treeview/template.md @@ -163,9 +163,7 @@ In the following sample, employee information such as employee photo, name, and } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/BZrICtCABhRfFWww?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Template](./images/blazor-treeview-template.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/BZrICtCABhRfFWww?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Template](./images/blazor-treeview-template.png)" %} ## Apply Template to Header @@ -326,6 +324,4 @@ The Blazor TreeView component provides the ability to customize the appearance o ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/htheCZiqVVQMJDpI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Header Template](./images/blazor-treeview-template-header.png) +{% previewsample "https://blazorplayground.syncfusion.com/embed/htheCZiqVVQMJDpI?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Header Template](./images/blazor-treeview-template-header.png)" %} diff --git a/blazor/treeview/virtualization.md b/blazor/treeview/virtualization.md index dd87004360..f2f500cc84 100644 --- a/blazor/treeview/virtualization.md +++ b/blazor/treeview/virtualization.md @@ -79,8 +79,6 @@ The following sample shows the example of Virtualization. } } ``` -{% previewsample "https://blazorplayground.syncfusion.com/embed/LXVSCNsUVVQcEAYN?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -![Blazor TreeView with Virtualization](./images/virtualization.gif) +{% previewsample "https://blazorplayground.syncfusion.com/embed/LXVSCNsUVVQcEAYN?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TreeView with Virtualization](./images/virtualization.gif)" %} N> Virtualization is not compatible with expand and collapse animation. Select all action will select only visible items in UI. \ No newline at end of file diff --git a/blazor/visual-studio-integration/template-studio.md b/blazor/visual-studio-integration/template-studio.md index bc7b844fb9..59698458dd 100644 --- a/blazor/visual-studio-integration/template-studio.md +++ b/blazor/visual-studio-integration/template-studio.md @@ -339,7 +339,7 @@ N> **Note:** Above culture combo box will be enabled in sample output if localiz #### Blazor Web App -##### Applying Database Migrations and User Registration in the .NET 8.0 and .NET 9.0 Blazor Web App +##### Applying Database Migrations and User Registration in the .NET 8.0, .NET 9.0 and .NET 10 Blazor Web App ##### Applying Database Migrations: