Code Monkey home page Code Monkey logo

blazor-1's Introduction

DevExpress UI for Blazor

This project demonstrates the DevExpress UI Components for Blazor.

The DevExpress UI components featured in this demo are available for free download and can be used in your next Blazor app.

Live Demo

  Check out this demo in live.

Examples

DevExpress Blazor components are shipped with GitHub feature-based examples. Refer to examples.md for more information.

Version Compatibility

The following table describes the version compatibility of .NET Core 3.0 and the DevExpress.Blazor NuGet package:

.NET Core 3.0 version DevExpress.Blazor.nuget version
.NET Core 3.0 Release 19.1.8 Release*
.NET Core 3.0 Release 19.1.7 Release*
.NET Core 3.0 RC1 0.4.1 RC
.NET Core 3.0 RC1 0.4.0 RC
.NET Core 3.0 RC1 0.3.3 Beta
.NET Core 3.0 Preview 9 0.3.2 Beta
.NET Core 3.0 Preview 9 0.3.1 Beta
.NET Core 3.0 Preview 8 0.3.0 Beta
.NET Core 3.0 Preview 8 0.2.0 Beta
.NET Core 3.0 Preview 7 0.1.0 Beta
.NET Core 3.0 Preview 6 0.0.12
.NET Core 3.0 Preview 6 0.0.11
.NET Core 3.0 Preview 6 0.0.10
.NET Core 3.0 Preview 5 0.0.9
.NET Core 3.0 Preview 5 0.0.8
.NET Core 3.0 Preview 5 0.0.7
.NET Core 3.0 Preview 5 0.0.6
.NET Core 3.0 Preview 5 0.0.5
.NET Core 3.0 Preview 4 0.0.4
.NET Core 3.0 Preview 3 0.0.3

* Starting with v19.1.7, DevExpress UI components for Blazor are distributed through a personal NuGet feed. Register at devexpress.com to subscribe to the feed.

Set Up Your Environment

  1. Install the latest Visual Studio 2019 update.
  2. Ensure that you have the latest .NET Core 3 version (from supported versions listed above) installed.

How to Run This Demo Locally

The Blazor framework uses either WebAssembly-based .NET runtime (client-side Blazor) or server-side ASP.NET Core (server-side Blazor). Our Blazor components support both of these approaches.

You can find appropriate demos in the repositories below:

  • demo/BlazorDemo.ServerSide
  • demo/BlazorDemo.ClientSide
  • demo/BlazorDemo.ClientSideWithPrerendering*

* For more information, see the Update Metadata at Runtime - Free SEO Tool blog post.

To open the required demo, do the following:

  1. Download the "demo" and tools folders from the proper repository.

  2. Use Visual Studio 2019 to open the solution file:

    demo/BlazorDemo.ServerSide/BlazorDemo.ServerSide.sln

    or

    demo/BlazorDemo.ClientSide/BlazorDemo.ClientSide.sln

    or

    demo/BlazorDemo.ClientSideWithPrerendering/BlazorDemo.ClientSideWithPrerendering.sln

  3. Go to nuget.devexpress.com, log in as a registered DevExpress customer and click Obtain Feed URL. The subsequent page displays a development account's NuGet Feed URL.

    Open the "Package Manager Settings".

    Open the "Package Manager Settings"

    Add new NuGet source:

    https://nuget.devexpress.com/{your feed authorization key}/api

    Add new NuGet source

  4. Install the "DevExpress.Blazor" NuGet package.

    Navigate to:

    Add new NuGet source

    Install the "DevExpress.Blazor" NuGet package.

    Add new NuGet source

  5. Start the application.

See also:

Official Microsoft Blazor site

How to Create a New Project

Follow the steps below to try our UI for Blazor in your own application.

  1. In the "Create a new project" dialog select "Blazor App".

Create New ASP.NET Core Web Application Project"

In the next step select a project template.

Create New ASP.NET Core Web Application Project"

  1. Go to nuget.devexpress.com, log in as a registered DevExpress customer and click Obtain Feed URL. The subsequent page displays a development account's NuGet Feed URL.

    Open the "Package Manager Settings".

    Open the "Package Manager Settings"

    Add new NuGet source:

    https://nuget.devexpress.com/{your feed authorization key}/api

    Add new NuGet source

  2. Install the "DevExpress.Blazor" NuGet package.

    Navigate to:

    Add new NuGet source

    Install the "DevExpress.Blazor" NuGet package.

    Add new NuGet source

  3. Build the project.

  4. Make sure the following folder is automatically created in your project’s wwwroot directory:

    Lib/dx-blazor
        dx-blazor/.gitignore
        dx-blazor/modules/
        dx-blazor/dx-blazor.js
        dx-blazor/dx-blazor.css
    

    For existing Blazor projects, copy the DevExpress static files from the Lib/dx-blazor folder to the appropriate folder in your project.

    The Lib/dx-blazor folder is automatically cleared while the project is built and contains static files for an installed nuget package only. Do not store your files here.

  5. Link the dx-blazor.js and dx-blazor.css files to your layout’s HEAD section:

    • For server-side Blazor, add the lines below to the _Host.cshtml file.
    • For client-side Blazor, add the lines below to the Index.cshtml file.
    <head>
        ...
        <link href="lib/dx-blazor/dx-blazor.css" rel="stylesheet" />
        <script src="lib/dx-blazor/dx-blazor.js"></script>
    </head>

    Reference this JavaScript file only because the dx-blazor/dx-blazor.js file is the entry point for DevExpress module files.

  6. Register DevExpress.Blazor namespace in _Imports.razor file:

    @using DevExpress.Blazor
  7. Your application is ready to use DevExpress Blazor.

Free Blazor Utilities and Dev Tools

The following DevExpress Blazor products are available free-of-charge:

Troubleshooting

1. There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions in 'CircuitOptions.DetailedErrors'.

If you see this error message or a similar message, add the following code to the ConfigureServices method declared in the Startup.cs file:

services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; });

This provides more detailed information about these errors.

2. Could not find 'X' in 'window.DxBlazor'.

Earlier, our clients' scripts were manually added to a project. Now, we automatically distribute them with the NuGet Package in the lib/dx-blazor folder (see the 6th item of the How to create a new project paragraph). So, our users may face such an issue if they reference an old version of our static files instead of the new one. For example, a similar issue was discussed in the I have a formlayout error when running a Blazor website SO thread.   If solutions suggested there do not help, create an issue here or submit a ticket in our Support Center so that we can investigate your case.

3. DxDataGrid in Blazor

If you use Blazor (client-side) with DxDataGrid, you may see the following exception in a browser:

Troubleshooting - No Generic Method 'Take' On Type System.Linq.Queryable

"System.InvalidOperationException: No generic method 'Take' on type 'System.Linq.Queryable' is compatible with the supplied type arguments and arguments."

The solution is to follow the official Blazor documentation.

So, you can either Disable linking or Control linking.

In case you decide to control linking: the following types types must be added in the Linker.xml file:

    <type fullname="System.Linq.Expressions*" />
    <type fullname="System.Linq.Queryable*" />
    <type fullname="System.Linq.Enumerable*" />
    <type fullname="System.Linq.EnumerableRewriter*" />

So, the Linker.xml file should look as follows:

<?xml version="1.0" encoding="UTF-8" ?>
...
<linker>
  <assembly fullname="mscorlib">
...
    <type fullname="System.Threading.WasmRuntime" />
  </assembly>
  <assembly fullname="System.Core">
...
    <type fullname="System.Linq.Expressions*" />
    <type fullname="System.Linq.Queryable*" />
    <type fullname="System.Linq.Enumerable*" />
    <type fullname="System.Linq.EnumerableRewriter*" />
  </assembly>
...
  <assembly fullname="[PUT YOUR ASSEMBLY NAME HERE]" />
</linker>

4. DxTabs are rendered incorrectly when the default Microsoft template is applied

If you create a new Blazor project based on the default Microsoft project template, the first tab of the DxTabs component can be rendered incorrectly.

This is caused by the following Microsoft issues:

To resolve this issue, write more strict style rules in the site.css file so that they only apply .navbar templates.

Included Demo Modules

  • Data Grid
    • Column Types
    • Sort Data
    • Grouping
    • Data Filter Row
    • Selection
    • Templates
    • Scrolling
    • Virtual Scrolling
    • Cascading Editors
    • Edit Form Template Validation
    • Master-Detail
    • Large Datasets
  • Pivot Grid
    • Data Binding Basics
    • Templates
    • Large Datasets
    • Chart Integration
  • Charts
    • Series Types
    • Dynamic Series
    • Range Series
    • Financial Series
    • Pie Series
    • Customization
    • Series Customization
  • Scheduler
    • Day View
    • Work Week View
    • Week View
    • Recurring Appointments
  • Data Editors
    • Calendar
    • ComboBox
    • Date Edit
    • List Box
    • Spin Edit
    • Text Box
  • Navigation and Layout
    • Form Layout
    • Pager
    • Popup
    • Tabs
    • TreeView
  • Form Validation

NuGet Package Change Log

Check out thе NuGet package's version history.

blazor-1's People

Contributors

sergeyseleznyov avatar nikolaevairina avatar donhuvy avatar zabelin-vladimir avatar akorenchikov avatar mpreyskurantov avatar outsidergiant avatar vladimirfrizen avatar nelda4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.