Quantcast
Channel: ASP.NET Team Blog
Viewing all 398 articles
Browse latest View live

ASP.NET, MVC, and XAF Popup Control – Google Chrome v75 Render Issue

$
0
0

Recently, we discovered an issue with Google's latest Chrome browser: our Popup Control will not render page content inside Chrome version v75 (specifically v75.0.3770.80).

The issue was caused by Chrome's inability to correctly render IFrame content when using the src attribute. If you'd like to learn more, please take a look at our bug report on chromium.org:

Issue 971641: Chrome 75 does not render IFRAME content if the content was specified using "src" attribute with some delay

What's affected?

The following components are affected by this issue:

  • WebForms ASPxPopupControl
  • PopupControl MVC Extension
  • XAF Pop-up Window

If you set a URL using either the client-side SetContentUrl method or the ContentUrl property, the popup window will appear empty.

Solution

We've addressed Google’s bug in the following versions (available early next week):

  • v18.1.13
  • v18.2.10
  • v19.1.4

If you need a workaround for current versions, register the following script at the bottom of your HTML page (before the body closure tag):

<body><form id="form1" runat="server">
        ...........</form><script>
        if (window.ASPx && ASPxClientUtils.webKitFamily && ASPxClientUtils.browserVersion >= 75) {
            ASPx.SSLSecureBlankUrl = "about:blank";
        }</script></body>

This workaround should be implemented on each web page that contains our Popup control. If you use a MasterPage (or LayoutView in MVC), register the same script in those pages instead of each content page/view.

If you run in to any issues then please contact our support team and they can help you.


Upgrade to jQuery v3.4.1+ - DevExpress Controls

$
0
0

In late March 2019, a new medium-level jQuery security vulnerability was disclosed.

This vulnerability is specific for jQuery versions older than v3.4.0 and we encourage you to upgrade to jQuery v3.4.1+.

In this post, I'll discuss why you should update both your jQuery and DevExpress installation.

jQuery Prototype Pollution

The new jQuery 'prototype pollution' vulnerability can be dangerous to your websites because:

This security vulnerability referred to and manifests as prototype pollution, enables attackers to overwrite a JavaScript application object prototype. When that happens, properties that are controlled by the attacker can be injected into objects and then either lead to denial of service by triggering JavaScript exceptions, or tamper with the application source code to force the code path that the attacker injects. - Liran Tal

Specifically, the jQuery.extend() method is affected:

"jQuery before 3.4.0, as used in Drupal, Backdrop CMS, and other products, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable proto property, it could extend the native Object.prototype." - CVE-2019-11358 Detail

For more information on this vulnerability, please refer to the following posts:

DevExtreme, Web Reports, & Dashboards

This vulnerability affects customers who use DevExtreme, Web Reports, or Dashboards.

Our DevExtreme components use the aforementioned jQuery.extend() method. Since DevExpress Web Reports and Dashboards use the DevExtreme widgets, they are also affected by this vulnerability.

The good news: this vulnerability has been fixed in jQuery v3.4.1+. As such, we've updated the following versions of our product suite:

  • v18.1.12
  • v18.2.9
  • v19.1.4

I recommend that you install our update - this will be the easiest way to move to jQuery v3.4.1.

Our ASP.NET MVC extensions do not use the jQuery.extend() method and subsequently, are not affected. However, for safety and consistency, we've upgraded the jQuery version used by our ASP.NET MVC library as well.

Upgrade npm packages

The following Dashboards and Web Reports npm packages are also affected:

  • @devexpress/analytics-core,
  • devexpress-reporting, and
  • devexpress-dashboard.

These packages have jQuery dependency version >= 3.3.1. Please run the following command and it'll update your jQuery to the latest version:

npm i jquery

If you encounter any issues, please contact our support team for immediate assistance.

ASP.NET WebForms for Bootstrap - New Controls & Enhancements (v19.1)

$
0
0

Our most recent ASP.NET Bootstrap release (v19.1) includes a number of new controls and usability enhancements.

New Color Edit

This release includes a new Bootstrap Color Edit control. Its features include:

  • Color indicator
  • Custom color picker
  • Automatic / favorite color item
  • Custom palettes

DevExpress ASP.NET Bootstrap Color Edit

We ported this control from our existing ASP.NET Color Edit control so it provides the same set of features and functionality.

Demo

New Floating Action Button

Our new Floating Action button encapsulates popular end-user actions (e.g., CRUD operations, data sorting, filtering, etc.). Floating Action buttons are fully configurable and support custom actions.

Key features include:

  • Container indication
  • Fixed position
  • Customizable appearance

DevExpress ASP.NET Bootstrap Floating Action Button

This button includes the same features as our ASP.NET Floating Action Button (introduced in late 2018).

For those unfamiliar with our ASP.NET Floating Action Button – This new button element hovers over other controls and offers easy access to common actions. It can be used to replace context menus, toolbars, etc. Take a look at how the Floating Action Button can be used in the Grid View control:

DevExpress ASP.NET Bootstrap Floating Action Button with Grid

Demo

Drop-down Editors - Adaptivity Enhancements

With this release, DevExpress Bootstrap drop-down editors (ComboBox, DateEdit, etc.) can switch to modal mode based upon browser width:

DevExpress ASP.NET Bootstrap Drop Down

Demo

Date Edit - Scroll Picker

We added a new mobile-friendly way to select dates with the DevExpress Bootstrap DateEdit control:

Demo

These features were inspired by the adaptivity enhancements in our ASP.NET Data Editor library.

As always, we’d love your feedback – Tell us what you think of these new DevExpress ASP.NET Bootstrap controls and adaptivity enhancements? Comment below or submit a support ticket via our Support Center.

ASP.NET MVC Case Study - SmartWeb

$
0
0

Want to see how other developers use DevExpress products?

If so, we’ve published a short case study that details how Escola Pinheiro (a K-12 school in Brazil) used our ASP.NET MVC controls to build SmartWeb. SmartWeb gives students, parents, and teachers a platform through which to communicate grades, reports, schedules and upcoming homework assignments.

SmartWeb Case Study

Do You Have a Story to Share?

We'd love to publish your story on our website. It doesn’t matter if the project is big or small, or which DevExpress tools you used. Fill out this simple case study form and email us at clientservices@devexpress.com.

DevExpress UI for Blazor - Developer Diary and Preview 10 (Now Available)

$
0
0

The following is a brief summary of changes made to our Blazor product line over the last few weeks.

If you’ve not yet reviewed our Blazor product line, please be certain to check out our Blazor Components webpage. If you are new to Blazor, feel free to review our 4-part Blazor training videos on YouTube.

DevExpress Blazor - Pivot Grid

What's New

After releasing Preview 7, we've added new features and fixed bugs in the following releases:

Preview 8

For this release, we focused on the following Data Grid Enhancements:

Cascading combo boxes that can be used in the cell's Edit Template

Support for Edit Form templates:

DevExpress Blazor - Grid Edit Form Template

Implemented Validation for default Edit Form editors

DevExpress Blazor - Form Validation

Fixed issues

The NullReferenceException occurs after you cancel new row editing.

Preview 9

We addressed the following issue in the Blazor framework:

[Blazor] onclick event no working on some element in iPhone browser. #10725

This issue affected our Data Grid and ComboBox editors as they would not always respond to the onClick event in iPhone Safari browsers.

Note, this Blazor issue is still not resolved. I recommend testing your other UI elements of your Blazor application and make sure they work correctly on iOS devices. You can use TestCafe Studio to create functional tests and catch these types of issues. Learn more here.

We also fixed the following issue: a NullReferenceException occurrs when the FormLayout component is bound to a Model with null values or Data Grid editors are empty (i.e., contain a null value).

Preview 10

We added support for Blazor Preview 6. No Breaking Changes were introduced.

Demos

Test the updated demos online here: DevExpress Blazor Themes - Online Demo

Download the Preview from NuGet

The recent version is available using the following DevExpress NuGet Early Access feed:

https://nuget.devexpress.com/early-access/api

If you are a new user, please refer to this article to learn more about how you can get started with Blazor today.

This preview is made available under the DevExpress Blazor UI license. To gain access to the build free of charge, you will need a DevExpress.com account. You can create a free account to test our NuGet package and can get a free 30-day trial of all our components too.

Watch the Webinar

Your Feedback Matters

Please take a moment to answer the following questions and tell us more about your long-term web development plans?

ASP.NET Bootstrap - Responsive Project Template (v19.1)

$
0
0

In our v18.2 release cycle, we shipped a highly popular responsive project template for ASP.NET WebForms controls and MVC Extensions.

With our most recent release, we’ve extended the capabilities of our ASP.NET WebForms for Bootstrap suite with a similar project template. As you can see from the images below, this template allows you to create engaging and mobile-friendly apps with ease.

Desktop

DevExpress ASP.NET Bootstrap Responsive Project Template

Mobile

DevExpress ASP.NET Bootstrap Responsive Project Template

Tablet

DevExpress ASP.NET Bootstrap Responsive Project Template

The template consists of the following main elements:

  1. A header with an adaptive BootstrapToolbar control. It also contains an icon to hide the sidebar and theme switcher:

DevExpress ASP.NET Bootstrap Responsive Project Template

  1. The sidebar is generated by using predefined Bootstrap classes. It contains a BootstrapTreeView within it.

DevExpress ASP.NET Bootstrap Responsive Project Template

  1. The Overview page (Default.aspx) has a mobile-friendly dashboard-inspired layout. The page contains our most popular Bootstrap controls: BootstrapGridView, BootstrapCardView, BootstrapSchedulerDateNavigator, BootstrapScheduler, BootstrapChart.

DevExpress ASP.NET Bootstrap Responsive Project Template

All controls are placed in adaptive containers: UserControls you can find in the 'UserControls' subfolder.

  1. The 'Tasks data table' (TasksDataTable.aspx) page contains an adaptive BootstrapGridView. The grid has an additional toolbar whose content is based on the selection made within the main toolbar.

DevExpress ASP.NET Bootstrap Responsive Project Template

  1. The 'Event scheduling' (EventScheduling.aspx) page demonstrates stand-alone controls: BootstrapScheduler, BootstrapSchedulerDateNavigator and BootstrapListBox.

DevExpress ASP.NET Bootstrap Responsive Project Template

For more information, please review the project template’s content in our online demo:

https://demos.devexpress.com/RWA/BootstrapResponsiveTemplate/

You can find the new responsive project template in the DevExpress project template gallery:

DevExpress ASP.NET Bootstrap Responsive Project Template

Your Feedback is Welcome

We’d love to hear what you think:

Blazor Roadmap – What You Can Expect in the Next Few Months from DevExpress

$
0
0

Here’s a quick post on our upcoming development plans for Blazor. We expect to publish blog posts on each of these Blazor components in the next couple of months.

If you’re targeting Blazor for an upcoming project and would like to participate in our beta (August, 2019), please send an email to support@devexpress.com.

DevExpress-Blazor-Roadmap

New Blazor UI components

Products we expect to ship by Sept, 2019:

  • Scheduler
  • Charts
  • Popup control (modal mode only)
  • Toolbar
  • Popup menu
  • Calendar
  • TreeView
  • ListBox

Updated Blazor UI components

New features we expect to add to our existing Blazor product line:

Data Grid

  • Grouping
  • Filter enhancements
  • Multiple row selection
  • Virtual Scrolling
  • Master-detail support

Combo Box

  • Filtering support
  • Multiple column support
  • Custom values support

Should you have any questions, please feel free to comment below.

ASP.NET Rich Text Editor (for WebForms, MVC, .NET Core and Bootstrap) - New Client HTML Printing

$
0
0

In our most recent update (v19.1), we added client HTML printing support to our ASP.NET Rich Text Editor (this support is available to WebForms, MVC, Core, and Bootstrap versions of the control library).

Why New Client-side Printing?

In previous versions, our Rich Text Editor shipped with server-side printing support (for purposes of this blog post, I’ll refer to our old implementation as server-side printing). When printing was initiated on the server, our RichEdit Document Server generated a PDF document on the server using a server-side document model. Once prepared, the browser downloaded the document for subsequent printing.

The primary disadvantage of server-side printing is that the server-side document model does not have exact document layout information from the client-side. As a result, the PDF file’s layout differs from the one displayed within the browser. For example, if you print the following text block in our Rich Text Editor:

ASPNET-RichEdit-ClientPrinting

      you’ll obtain a slightly different result in the PDF file:

ASPNET-RichEdit-ClientPrinting

Though these differences may seem inconsequential, they are essential for some of our customers. Our new client-side printing engine resolves these minor discrepancies so that end-users can print what they see on-screen.

The Basics of Our New Client-side Printing Engine

Client-side HTML printing doesn’t initiate any server requests. Our Rich Text Editor opens a new browser tab, renders document layout (HTML markup) within this tab and activates the default print dialog of the web browser.

How to Enable Client HTML Printing

Please note that server-side printing is enabled by default. To switch your apps to client-side printing, set the PrintMode property to ClientHtml:

ASPxRichEdit1.Settings.Printing.PrintMode = PrintMode.ClientHtml;

Once you start using our client-side printing option, the same text block that was slightly altered when sent to PDF (server-side printing), is now identical to that displayed within the browser:

ASPNET-RichEdit-ClientPrinting

See Print Out a Document for more information on this new client-side printing option.

Limitations

  • Client-side print performance is driven by document size and information complexity. Simple documents are printed faster than the server-side counterpart. Complex documents may take longer to print.
  • Paper format in Printer settings must be the same as the paper format used in the RichEdit (otherwise, the browser will split content incorrectly).

Feedback

We want to hear your thoughts. Please tell us what you think of this new capability and how you expect to use it in an upcoming project. Are you currently happy with our server-side print implementation? Do you expect to you use this new client-side print option?


ASP.NET AJAX Control Toolkit v19.1.0 - Now Available

$
0
0

A few years ago, we took over maintenance and guidance for the ASP.NET AJAX Control Toolkit project. Please refer to this blog post for more information on the project and why we stepped in to assist.

As part of our ongoing commitment to the project, we’ve released an update (ASP.NET AJAX Control Toolkit v19.1.0) to address the following issues.

Improvements

  • Visual Studio 2019 Support
  • Security hardening: HTML-encode file names in AjaxFileUpload (#483)

Resolved Issues

  • AutoCompleteExtender: the TextChanged event is not fired in Edge (#458)
  • Rating: The raise_mouseOver method has an invalid argument name (#461)
  • AsyncFileUpload changes the frame target to _top (#466)
  • HtmlEditorExtender unconditionally removes tags with data URLs (#467)
  • NRE in IsLocalizationEnabled() within a PageAsyncTask (#486)

Ready to Upgrade?

To update the ASP.NET AJAX Control Toolkit, please download our most recent installer using the link below.

Download

Or, if you prefer, use Nuget:

ASP.NET AJAX Control Toolkit Nuget package

As always, we welcome your feedback. Please share your thoughts on this update via GitHub.

Want More? Try the DevExpress ASP.NET Subscription for 30-days

We’d like to thank you for installing the DevExpress Edition of the AJAX Control Toolkit and look forward to your feedback as you begin leveraging its capabilities.

If you require additional UI controls for your ASP.NET WebForms application, we invite you to download and try a free 30-day evaluation of our ASP.NET Subscription. With over 100 UI controls, the DevExpress ASP.NET Subscription helps you build your best, and deliver elegant line-of-business applications in the shortest possible time. For a complete list of products and features in our ASP.NET Subscription, please refer to the following webpage.

DevExpress UI for Blazor - Preview 11 - New Blazor TreeView Component and Enhanced ComboBox Features (Now Available)

$
0
0

Preview 11 of the DevExpress UI for Blazor is now available and it includes a new TreeView component and enhanced features for the ComboBox component.

Blazor UI Components – New Blazor TreeView Component

If you’re targeting Blazor and need to use a TreeView in your project, take a look at the following demo for more information on our new Blazor TreeView UI control.

DevExpress Blazor TreeView Component

This new components presents hierarchical data within a tree structure. Parent nodes can be collapsed or expanded – and individual nodes can be selected as necessary. The component ships with three API events to manage component behavior.

Blazor ComboBox

Preview 11 ships with several enhancements to our Blazor ComboBox.

Allow User Input

The component allows end-users to enter custom text into the text box when the value does not match a drop-down item. To enable this feature, set the AllowUserInput property to true.

To learn more, see to Combo Box - Allow Input online demo.

Filtering

Our Blazor ComboBox supports two filter modes and now allows end-users to locate combobox items more quickly. Assign “Contains” or “StartsWith” to the FilteringMode property to enable the desired filter mode.

To learn more, see the Combo Box - Incremental Filtering demo.

Keyboard Support

To help improve the end-user experience, Preview 11 includes built-in Keyboard Support. At present, the following shortcuts are supported:

  • Alt+Up or Alt+Down – Toggles the drop-down window
  • Up/Down – Moves focus to the previous/next item within the drop-down window
  • PageUp/PageDown - Scrolls 5 rows (up or down) within the drop-down window
  • Ctrl+Home/Ctrl+End – Scrolls and moves focus to the first/last item in the drop-down window

Blazor Demo Redesign

As our Blazor component library grows, so does our online demo collection. We used our new TreeView to simplify navigation within the demo and updated the appearance of the demo with the ‘Pulse’ Bootstrap theme.

Your Feedback Matters

We want to hear from you. If you’re currently using Blazor, or expect to do so in the near future, please share your thoughts with us below.

ASP.NET Bootstrap Scheduler - UI Enhancements for Mobile Devices

$
0
0

We’ve extended the capabilities of our ASP.NET Bootstrap Scheduler control in our most recent release (v19.1) with the following mobile-specific features:

Date Navigator UI

We redesigned the control’s Date Navigator UI. We removed the 'Today' button and made the date item clickable. Once clicked, a calendar UI element appears on-screen (used for date selection). By making this change, we saved space and moved the 'previous date' and 'next date' buttons closer to one another.

Bootstrap Date Navigator in v18.2:

DevExpress Bootstrap Scheduler

Bootstrap Date Navigator in v19.1:

DevExpress Bootstrap Scheduler

Demo

Date Highlighting within the Date Navigator

Our Bootstrap Date Navigator can now display appointment marks within individual date items.

DevExpress Bootstrap Scheduler

As you can see, this feature makes it easier to find free or busy days within one’s schedule.

View Selector Adaptivity Enhancements

We upgraded View Selector adaptivity. The following animation demonstrates the difference between our new release and its predecessor.

DevExpress Bootstrap Scheduler

Built-in Floating Action Button

The Bootstrap Scheduler includes built-in Floating Action buttons. These buttons already support key scheduler-related actions (such as adding, editing or deleting appointments).

You can customize the Floating Action button and introduce custom actions as needed. In this demo, we replaced our predefined user actions with custom actions.

DevExpress Bootstrap Scheduler

Demo

As always, we’d love to hear your feedback. Please tell us how you’re using our ASP.NET Scheduler on mobile devices? How likely are you to use these features in your next Bootstrap application?

ASP.NET Core File Manager – Thumbnail Generator Service

$
0
0

Our most recent release (v19.1) includes a new ASP.NET Core File Manager control. Though the component is currently available as a Community Tech Preview (CTP), our customers tell us they’ve already put the control to use in real applications.

In this post, I’ll demonstrate how you can enable preview thumbnails for image files within the ASP.NET Core File Manager control.

Preview Thumbnails

Image thumbnails are important UI elements within all modern file explorers (be it Explorer on PCs or Finder on Macs).

DevExpress-ASPNETCore-FileManager

At present, our File Manager displays default thumbnails for all files. We will support preview thumbnails in a future release. If you’re already using the File Manager in your web app, you can introduce image previews via our Thumbnail Generator service. Simply add it to your project to enable image previews.

Under the Hood

The ThumbnailGeneratorService.cs file contains the code needed to generate custom thumbnails. We use the System.Drawing.Common library to create icons based on your image files.

How to Install

  1. Add the ThumbnailGeneratorService.cs file to your ASP.NET Core Web Application without any modifications.

  2. Register the service in the Startup.cs file:

services
    .AddSingleton<IActionContextAccessor, ActionContextAccessor>()
    .AddSingleton<IThumbnailGeneratorService, ThumbnailGeneratorService>()
  1. Сreate a new method (e.g. FileSystem) in a controller to inject the ThumbnailGenerator service using Dependency Injection:
public IActionResult FileSystem(FileSystemCommand command, string arguments) {
  var config = new FileSystemConfiguration {
      FileSystemProvider = new DefaultFileProvider(rootPath,
          ThumbnailGenerator.AssignThumbnailUrl),
          // ...
       };
       var processor = new FileSystemCommandProcessor(config);
       var result = processor.Execute(command, arguments);
       return Ok(result.GetClientCommandResult());
 }
  1. Assign a custom icon URL to each File Manager item in the customizeThumbnail method:
$(function(){
    $("#fileManagerContainer").dxFileManager({
       // ...
       customizeThumbnail: function (fileManagerItem) {
          return fileManagerItem.dataItem ? fileManagerItem.dataItem.thumbnailUrl : null;
       }
    });
});

You should not see image thumbnails within the DevExpress File Manager control.

DevExpress-ASPNETCore-FileManager

Unix-based Systems

If you encounter the "System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found" exception, please install GDI+.

MacOS

For MacOS systems, call the following command into terminal to install GDI+:

brew install mono-libgdiplus

Survey

We'd love to hear your feedback.


DevExpress UI for Blazor - Virtual Scrolling in Preview 12 (Now Available)

$
0
0

Preview 12 of the DevExpress UI for Blazor is now available and it includes virtual scrolling support for two of our Blazor components.

If you’ve not yet reviewed our Blazor product line, please be certain to check out our Blazor Components webpage. If you are new to Blazor, feel free to review our 5-part Blazor training videos on YouTube.

What's New

Data Grid - Virtual Scrolling

The DevExpress Blazor Data Grid now supports virtual scrolling – allowing your end-users to navigate individual grid rows via the control’s vertical scrollbar.

Use the DataNavigationMode property to enable virtual scrolling:

<DxDataGrid Data=@DataSource
  ...
  DataNavigationMode="@DataGridNavigationMode.VirtualScrolling"
  ...</DxDataGrid>

ComboBox - Virtual Scrolling

The DevExpress Blazor ComboBox can now load visible items within its drop down list (loads data virtually and on demand). This improves performance when binding to a large dataset.

Set the DataLoadMode property to enable virtual scrolling:

<DxComboBox Data=@Strings
  DataLoadMode="@ComboBoxDataLoadMode.VirtualScrolling"
  FilteringMode="@FilteringMode.Contains"
  @bind-SelectedItem=@SelectedItem></DxComboBox>

Demos

You can test our new virtual scrolling demos using the following links:

Download the Preview from NuGet

Our most recent version is available via the DevExpress NuGet Early Access feed:

https://nuget.devexpress.com/early-access/api

If you are a new user, please refer to this article to get started with Blazor today.

This preview is made available under the DevExpress Blazor UI license.

To obtain the build, you will need a DevExpress.com account. Create your free account online or contact us for assistance.

Watch the Webinar

Your Feedback Matters

DevExpress Blazor - Update Metadata at Runtime - Free SEO Tool

$
0
0

In this blog post, I'll discuss a limitation in the Blazor framework and our new utility designed to address it.

As you may know, the Blazor framework does not provide any way to change a document's metadata at runtime (for document metadata: page title, meta tags, and other SEO-related data).

Our utility fixes this issue and is available free of charge.

How to Use the DevExpress SEO Metadata Utility

To get started, you'll need to add our SEO Metadata Utility to your project:

  1. Download the DevExpress Document Metadata project source code from GitHub.
  2. Add the Document Metadata project to your Blazor solution in Visual Studio.

Then follow these steps to learn how to configure the tool.

Server Side Blazor

I'll discuss the server side approach first. Details on the client-side approach are below.

How to Add Default Document Metadata

  1. Add the DocumentMetadata component to a page header:
<head>
    @(await Html.RenderComponentAsync<DocumentMetadataComponent>())
    ...</head>
  1. Call the AddDocumentMetadata() extension method to register default document metadata:
using DevExpress.Blazor.DocumentMetadata;
namespace BlazorDemo.ServerSide
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDocumentMetadata((IServiceProvider serviceProvider,
                IDocumentMetadataRegistrator registrator) => {
                registrator.Default()
                    .Title("Blazor UI Components")
                ...
            });
        }
        ...
    }
}

Note, the registrator.Default() method returns a document metadata builder. Use this builder to register metadata defaults for all pages:

registrator.Default()
    .Base("~/")
    .Charset("utf-8")
    .TitleFormat("Demo: {0} | DevExpress")
    .Viewport("width=device-width, initial-scale=1.0")
    .OpenGraph("url", https://dxpr.es/2WogLq7)
    ...

How to Add Custom Document Metadata

  1. You can also load metadata from a database, text file, or any other supported storage location. For example, in our demo application, we store the pages' metadata in a 'DemoConfiguration' section of the appsettings.json file:
{"DemoConfiguration": {"SiteMode": false,"DemoPages": [
      {"Url": "","Title": "Blazor UI Components","NavLinkText": "Overview","Icon": "images/Overview.svg","IsUpdated": true,"TitleFormat": "Demos: {0} | DevExpress"
      },
      {"Url": "GridColumnTypes","Title": "Grid - Column Types","Icon": "images/GridColumnType.svg"
      },
      ...

The following code loads metadata from appsettings.json:

services.Configure<DemoConfiguration> Configuration.GetSection("DemoConfiguration"));
  1. Call the AddDocumentMetadata() method to add custom metadata to web pages:
services.AddDocumentMetadata((serviceProvider, registrator) => {
    var config = serviceProvider.GetService<IOptions<DemoConfiguration>>().Value;
    config.RegisterPagesMetadata(registrator);
});

The config.RegisterPagesMetadata() method populates the service with custom metadata. The following code assigns default metadata for all pages and also specifies the page title for each page:

public class DemoConfiguration
{
    public List<DemoPageConfiguration> DemoPages { get; set; }
    public void RegisterPagesMetadata(IDocumentMetadataRegistrator registrator)
    {
        registrator.Default()
            .Charset("utf-8")
            .TitleFormat("Demo: {0} | DevExpress"); 
        DemoPages.ForEach(pageMetadata => {
            IDocumentMetadataBuilder metadataBuilder = registrator.Page(pageMetadata.Url);
            metadataBuilder.Title(pageMetadata.Title);
            if (!string.IsNullOrEmpty(pageMetadata.TitleFormat))
                metadataBuilder.TitleFormat(pageMetadata.TitleFormat);
        });
    }
}

The TitleFormat() method sets the format for text assigned using the Title() method. If the page title format is not set then the page title is displayed as is.

Client-Side Blazor

Client-side Blazor apps present a challenge because they only render page markup after the web assembly has been loaded. Since search engine crawlers do not read web assembly files, they only get to scan simple HTML pages with static content and meta tags.

So, to update metadata for a client-side Blazor application, you'll need to create both a server-side and client-side Blazor projects. The client-side project code is compiled to a web assembly and will work in the end user's browser. While the server-side project will host the client-side project on your server, deliver the web assembly to the client,and handle requests to the server side. This approach is based on Microsoft's recommendation for Client-side Blazor applications with pre-rendering.

How to Add Default Document Metadata

If you want to add default meta tag set for all Blazor application pages, add metatags to the Page/_Host.cshtml page located in the server-side project. You can see an example of this here.

How to Add Custom Document Metadata

  1. Enable pre-rendering in your blazor application because it allows you to add page-specific meta tags and improve your website's SEO parameters. Start by adding a reference to your client-side Blazor project to the server-side Blazor project:

DevExpress Blazor SEO Tool

Then call the app.UseClientSideBlazorFiles() method in the server-side application's Startup.cs file. Use the client-side application's Startup class as a generic parameter:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{…
    app.UseClientSideBlazorFiles<ClientSide.Startup>(); 
    app.UseHttpsRedirection(); 
    app.UseStaticFiles();
    app.UseRouting();
    app.UseEndpoints(endpoints =>
    {
        endpoints.MapDefaultControllerRoute();
        endpoints.MapFallbackToPage("/_Host");
    });
}
  1. Once page pre-render is enabled, call the render the RenderStaticComponentAsync() method with the DocumentMetadata component in the Page/_Host.razor page of your server-side Blazor application:
<head>
    @(await Html.RenderStaticComponentAsync<DocumentMetadataComponent>())</head>

Note that no additional content is allowed inside the 'head' tags in this case.

  1. Register the DemoConfiguration options and the DocumentMetadata service in both client-side and server-side Blazor projects:
services.AddSingleton<IOptions<DemoConfiguration>, ClientSideDemoConfiguration>(); services.AddDocumentMetadata((serviceProvider, registrator) =>
{
    DemoConfiguration config = serviceProvider.GetService<IOptions<DemoConfiguration>>().Value;
    config.RegisterPagesMetadata(registrator);
});

The appsettings.json configuration file is not transferred to the client side. Therefore, page metadata is populated in the PopulateDemoPages() method of the DemoConfiguration class.

void PopulateDemoPages()
{
    DemoPages.Add(new DemoPageConfiguration() {
        Url = "",
        Title = "Blazor UI Components",
        NavLinkText = "Overview",
        Icon = "images/Overview.svg",
        IsUpdated = true,
        TitleFormat = "Demos: {0} | DevExpress"
    });
    DemoPages.Add(new DemoPageConfiguration() {
        Url = "GridColumnTypes",
        Title = "Grid - Column Types",
        Icon = "images/GridColumnType.svg"
    });
…

Since we have a reference to the client-side Blazor project in the server-side project, this class is available in both projects. You can use it in the server-side Blazor project instead of appsettings.json.

  1. Add the DocumentMetadata component to the Components Application Builder in your client-side Blazor project:
public void Configure(IComponentsApplicationBuilder app)
{
    app.AddComponent<App>("app");
    app.AddComponent<DocumentMetadataComponent>("head");
}

This way, the DocumentMetadata component renders content inside the 'head' HTML tag when an end-user changes web pages in a browser.

The SEO tool is now enabled.

Source code

You can find the SEO Metadata tool source code here:

https://github.com/DevExpress/Blazor/tree/master/tools/DevExpress.Blazor.DocumentMetadata

An example of a server-side Blazor application with the use of the SEO Metadata tool:

https://github.com/DevExpress/Blazor/tree/master/demo/BlazorDemo.ServerSide

An example of a client-side Blazor application with the use of the SEO Metadata tool:

https://github.com/DevExpress/Blazor/tree/master/demo/BlazorDemo.ClientSideWithPrerendering

Your Feedback Matters


ASP.NET Spreadsheet - Enhancements (v19.1)

$
0
0

In our most recent update (v19.1), we added two major enhancements to our ASP.NET Spreadsheet (the features described herein are available for the WebForms, MVC, Core, and Bootstrap versions of the DevExpress Spreadsheet control).

Client-Side API Enhancements

We've added a new client-side Print command so you can easily invoke the browser's Print dialog.

DevExpress-ASP-Spreadsheet-ClientPrint

<script>
        function onPrintButtonClick(s, e) {
            spreadsheet.Print("_self");
        }</script><dx:ASPxButton runat="server" Text="Print document" AutoPostBack="false" Image-IconID="actions_print_16x16devav"><ClientSideEvents Click="onPrintButtonClick" /></dx:ASPxButton>
Note: Send "_self" to the Print method to display the print dialog on the same page. To display the dialog on a new page, send "_blank" to the method.

If the browser does not support printing, you can export your workbook to PDF. To learn more about client-side printing, please take a look at this blog post.

Culture-Specific Format

The Format Cells dialog allows you to apply culture-specific formatting to date and numeric values.

DevExpress-ASP-Spreadsheet-CultureFormat

Сulture-specific formatting is applied to a date or numeric cell values based on the current culture (locale). Use the following steps to change the default locale for the Date values:

  • Select a cell or cell range to format
  • Right click on the selection and choose the "Format Cells" menu item
  • Click the Date category on the left side of the dialog
  • Using the "Locale" combo-box, choose a country or region that uses the required date format
  • Select the required date format. The Sample region on the dialog will display a preview of the formatted value
  • Click "OK" to apply the changes

You can also change the default locale for Time, Currency and Accounting type values.

Feedback

We want to hear your thoughts. Please tell us what you think of these new capabilities and how you expect to use it in an upcoming project. Are you currently happy with our server-side print implementation? Do you expect to you use this new client-side print option?


Blazor Components - New Blazor Scheduler Control, Data Grid Enhancements and more (available in Beta #1)

$
0
0

As you may know, DevExpress released the first preview of its Blazor UI components in April. Thanks to your outstanding feedback, we are inching closer to our official release.

Our first beta brings with it a new Blazor Scheduler component along with a myriad of enhancements designed to improve the overall capabilities of our Blazor product line.

Blazor Preview 7 Support

Microsoft recently announced availability of Blazor Preview 7. The components in our first beta fully support Preview 7.

New Blazor Scheduler Component

A picture is worth a thousand words…Here is a screenshot of our new Blazor Scheduler component (available in Beta #1).

DevExpress Blazor - Scheduler Component

Mobile Friendly

The component is ready for the use on desktop and tablets alike. We plan to add a mobile-optimized Agenda view in a future release.

Scheduler Views

The DevExpress Blazor Scheduler control supports 3 calendar views: 'Day View', 'Work Week View', and 'Week View'. As its name implies, our 'Day View' displays appointments for single or multiple days. Use the DayCount setting to control day display count. The 'Work Week View' displays 5-day intervals. The 'Week View' displays appointments/events across a 7 day period. FirstDayOfWeek allows you to specify the first day of the week (Sunday by default).

Data Binding

To bind the Scheduler control to data, use the DxSchedulerDataStorage object. Populate AppointmentsSource and AppointmentMappings collections. The DxSchedulerDataStorage object supports additional fields for custom data:

  • Use AppointmentLabelsSource and AppointmentLabelMappings to display custom Labels within the Scheduler
  • Use AppointmentStatusSource and AppointmentStatusMappings to display custom event status

Once the DxSchedulerDataStorage object is created, you can assign it to the DxScheduler.DataStorage property or use it as a stand-alone data source to retrieve appointment data without adding the Scheduler component on a web page. See our online demo for more information.

Recurring Appointments

Our Blazor Scheduler control supports recurring appointments. To create a recurring appointment, add assign in the following format to the RecurrenceInfo field:

<RecurrenceInfo Start="07/23/2019 9:30:00" End="07/23/2019 11:00:00" WeekDays="36" Id="04dcc127-df56-49d7-baff-ce4b6264addd" OccurrenceCount="10" Range="1" Type="1" />

An appointment supports the following Ranges:

public enum RecurrenceType {
  Daily = 0,
  Weekly = 1,
  Monthly = 2,
  Yearly = 3,
  Minutely = 4,
  Hourly = 5,
}

and recurrence Types:

public enum RecurrenceRange {
  NoEndDate = 0,
  OccurrenceCount = 1,
  EndByDate = 2
}

Online Demo

Data Grid

Vertical and Horizontal Scrolling

Our Blazor Data Grid control now supports both vertical and horizontal scrolling. To activate scrolling, assign one of the following values to VerticalScrollBarMode and HorizontalScrollBarMode properties:

  • Auto– A scrollbar is automatically displayed when content size exceeds the component size.
  • Visible - The scrollbar is always visible.
  • Hidden - The scrollbar is hidden.

Use the VerticalScrollableHeight property to set the height of the visible scroll region.

Horizontal scrolling is fully compatible with the Virtual Scrolling mode. You can enable Virtual mode for vertical scrolling and a horizontal scrolling at the same time.

See the online demo for additional info.

Column Visibility

Our Blazor Data Grid now offers hidden column support. Use the Visible property to manage column visibility. Once you hide a column, its editor is no longer available. If you want to display the editor, assign one of the following values to the DxDataGridColumn.EditorVisible property:

  • Default– Column editor visibility is linked to column visibility. If the column is hidden, the editor is hidden as well. If the column is visible, the editor is also visible.
  • True– The Column editor is visible regardless of the column’s Visible property value.
  • False– The Column’s editor is always hidden.

TreeView

Data Binding

Our Blazor TreeView allows you to bind hierarchical data via any object that implements the IEnumerable interface (one that has a child item collection for use as a data source for the TreeView). Assign your data source to the TreeView.Data property and ChildrenExpression to obtain the child item collection used to bind our TreeView to data.

Additionally, our TreeView provides the following properties for custom data display:

  • TextExpression - A lambda expression that returns node text from a corresponding data item
  • NameExpression - A lambda expression that returns a node’s unique identifier (a name)
  • NavigateUrlExpression - A lambda expression that returns a node’s target URL
  • IconCssClassExpression - A lambda expression that returns the name of a CSS class applied to a node’s icon

To learn more, please review our TreeView - Binding to Hierarchical Data demo.

Note: This data binding implementation allows our Blazor TreeView to display Master-Detail relationships (nodes at different levels can be bound to different type item collections). See the TreeView - Master-Detail Data Binding demo to configure our TreeView to operate in this manner.

Form Layout

Items Visibility

We’ve added a Visible property to the following FormLayout items:

  • DxFormLayoutItem
  • DxFormLayoutGroup
  • DxFormLayoutTabPages
  • DxFormLayoutTabPage

You can now display or hide specific items, item groups or tabs by setting the Visible property to true or false.

Your Feedback

Your feedback matters. Please share your thoughts about this update below and tell us what you’d like to see us develop next for the Blazor platform.


DevExtreme-Based ASP.NET Controls support ASP.NET Core 3 Preview (v19.1.5)

$
0
0

Our DevExtreme-based ASP.NET controls are now compatible with the preview version of the upcoming ASP.NET Core 3.0 framework.

Thanks to your feedback, we fixed the TypeLoadExceptionissue which cleared the way for ASP.NET Core 3.0 compatibility.

DevExtreme versions 19.1.5 and 18.2.10 provide the above mentioned compatibility as well.

Enable in VS2019

The .NET Core 3 framework is set for release in September 2019. If you're curious about its features, I recommend testing our DevExtreme-based ASP.NET Controls with Visual Studio 2019 and .NET Core 3 Preview.

Helpful links:

Note: DevExtreme Visual Studio project templates and demos still use .NET Core framework v2.x, however, the "Add DevExtreme to the Project" context menu and Scaffolders work with 3.0-preview projects.

Your Feedback

Your feedback matters. Please share your thoughts about the upcoming .NET Core Preview 3 and tell us what you’d like to see us develop next for the DevExtreme-based ASP.NET controls.

ASP.NET Core Office components - New Spreadsheet and Rich Text Editor controls (available in v19.1)

$
0
0

As you may already know, we delivered CTP versions of both our ASP.NET Core Rich Edit and Spreadsheet components at the end of 2018. We officially launched these two products in our v19.1 release cycle. This post details some of the newest features available in the DevExpress ASP.NET Core Spreadsheet and Rich Edit control.

ASP.NET Core Spreadsheet

DevExpress ASP.NET Core - Spreadsheet

Document Customization

DevExpress ASP.NET Core Spreadsheet includes the following built-in document customization capabilities:

  • Configure the height and width of workbook columns and rows.
  • Manage worksheets as necessary: insert, delete, copy, move, rename sheets, and the like.
  • Add objects, such as hyperlinks, tables, pictures, and charts onto a sheet.
  • Sort and filter table data.
  • Validate data.
  • Add comments to a document.
  • Setup document protection.

Sort and Filter Table Data

With our Spreadsheet you can manage tables just as you would in Microsoft Excel. A header cell drop-down menu provides advanced options (including the ability to filter and sort data). You can also define custom filter commands to address unique usage scenarios.

Flexible Chart Appearance Settings

A set of context-specific dialogs allows you to customize both chart and table appearance settings.

Ribbon

The ASP.NET Core Spreadsheet’s built-in ribbon displays the appropriate context tab when you select a table, chart, or a picture. The tabs contain specific commands for a selected object.

Another new feature is custom ribbon buttons that allows you to implement more complex usage scenarios. Try our Ribbon Customization demo to see this feature in action.

Context Menu

DevExpress ASP.NET Core Spreadsheet now provides a context menu with a rich client-side API. You can populate the menu with your custom items and control menu visibility within the PopupMenuShowing event.

Differences with WebForms/MVC Spreadsheet

The following list details differences between our ASP.NET Core Spreadsheet and its WebForms/MVC counterpart.

  1. Page settings can only be set via its server-side API.
  2. Cell format can only be customized via its server-side API.
  3. Pivot table support is not yet available.
  4. Open and Save buttons are not provided because our customers prefer to implement their own document open and save functionality.
  5. At this point, we only support the English culture. We plan to localize the component in a future release.

See the ASP.NET Core Spreadsheet online demos to learn more about the myriad of features that ship with this component library.

ASP.NET Core Rich Edit

DevExpress ASP.NET Core - RichEdit

Ribbon Customization

In addition to default items available within the built-in ribbon, you can create custom items with custom functionality as needed. The CustomCommandExecuted event allows you to respond to a custom button click. You can use a new icon or choose an icon from the DevExtreme icon library.

See our online demo for additional info.

Client-Side API

DevExpress Rich Edit provides a comprehensive client-side API to manage documents, customize document content and appearance, change selection, etc. Refer to RichEdit API documentation for more info.

Mail Merge and Document Variables

Our ASP.NET Core Rich Edit provides Mail Merge functionality to create personalized documents as necessary. You can create a document with merged data using the following three steps:

  1. Provide a data source.
  2. Create a document template with merge field fields.
  3. Merge and save the document.

An end-user can preview merge results to make certain it is correct. In addition to the UI, the ASP.NET Core Rich Edit control includes a mailMerge method to initiate mail merge from code.

The control now supports a DocVariable field that can be replaced with custom text. Handle the CalculateDocumentVariable event to provide the text result.

See our online demo for more information.

Printing

The ASP.NET Core Rich Edit component includes client-side WYSWYG print support. The control renders the current document’s markup into a blank browser tab and calls the browser's print dialog.

Document Import and Export

The Rich Edit control allows you to import and export files in both Open-XML (.docx) and Plain text (.txt) formats. We plan to support Rich Text Format (.rtf) later this year.

Differences with WebForms/MVC Rich Text Editor

The following list details differences between our ASP.NET Core Rich Edit and its WebForms/MVC counterpart.

  • RTF support is not yet available. This feature will ship later this year.
  • Document protection is not yet available.
  • PDF printing is not yet available.
  • DocVariables can only be replaced with plain text.
  • At this point, we only support the English culture. We plan to localize the component in a future release.

Should you have any questions regarding our ASP.NET Core Spreadsheet or our ASP.NET Core Rich Edit, feel free to comment below. We’d love to hear your feedback.

Blazor Components - Tips & Tricks

$
0
0

The official launch date for ASP.NET Core 3.0, and Blazor is approaching fast. Thanks to your great feedback, we've created a number of useful samples for common usage scenarios. Check out the following examples to learn more about DevExpress UI for Blazor.

How to edit a row on a separate page

This example shows how to edit a DevExpress Blazor Data Grid on a separate page. The grid contains a template column with an Edit hyperlink that opens the edit form in a separate page. The browser redirects the user back to the primary page when editing is complete.

How to edit/delete the selected row by clicking external buttons

Learn how to edit and delete a selected row in code.

How to show/hide columns based on the value from external UI elements

See how you can use an external UI element (a check box) to manage Blazor Data Grid column visibility.

How to change DxFormLayout's item and group visibility

In this example, we demonstrate how to conditionally display form fields in a Blazor Form Layout (based on user selection).

How to create cascading grids

Learn how to setup master-detail rows within our Blazor Data Grid component. A detail grid is automatically populated with filtered data when a user selects a row from the master grid.

Useful Resources

Take a look at our support knowledge base and GitHub Blazor repository for more Blazor examples.

We've created a guide to help you create a new project and use DevExpress UI for Blazor / Razor Components.

Test drive our online demos to experience our versatile Blazor components at your own pace.

Your Feedback Counts

Help us shape the direction of our Blazor product line. Please share your Blazor experiences with us and tell us how you expect to use Blazor now and into the future.

ASP.NET Core File Manager - How to Display Files Hosted on Azure

$
0
0

If your web application stores files within a cloud service, file system visualization can be both cumbersome and time-consuming. In this blog post, we’ll briefly explain Azure storage and show you how you can use our ASP.NET Core File Manager to display hierarchical file information in your next web app.

Azure Data Storage

The following diagram illustrates Azure's storage structure in detail:

Azure Data Storage

Unlike a local file system, Azure stores files in blobs. A blob container can contain several blobs. By default, Azure provides the files as a plain list. If you want to display files and folders hierarchically, create a custom file storage based on Azure blob storage data. See Creating an Azure Blob Hierarchy.

Custom a Custom File System

To help get you started, we created a solution with a custom file system provider that organizes files into a hierarchical file system. Follow the steps below to include this solution in your application.

  1. Download this ASP.NET Core project’s source code.
  2. Add the project to your Visual Studio solution.
  3. Execute the following command in the Visual Studio NuGet Package Manager Console to install the Microsoft.Azure.Storage.Blob Nuget package:
    dotnet add package Microsoft.Azure.Storage.Blob --version 11.0.0
  4. To connect the DevExpress File Manager to Azure storage, create a custom file system provider that implements the IFileProvider interface (the AzureBlobFileProvider class in our sample).
  5. Use Azure SDK to implement the necessary code to manage (rename, remove, copy, etc.) storage data.
  6. Specify an account name, container name and corresponding access key to access the appropriate container in your storage.
  7. Assign your custom file system provider to the FileSystemConfiguration.FileSystemProvider property and apply security permissions to files and folders:
public IActionResult FileSystem(FileSystemCommand command, string arguments)
{
	var config = new FileSystemConfiguration
    {
		Request = Request,
		FileSystemProvider = new AzureBlobFileProvider(),
		AllowCopy = true,
		AllowCreate = true,
		AllowMove = true,
		AllowRemove = true,
		AllowRename = true,
		AllowUpload = true,
		UploadTempPath = _hostingEnvironment.ContentRootPath + "/wwwroot/UploadTemp"
	};
    var processor = new FileSystemCommandProcessor(config);
   	var result = processor.Execute(command, arguments);
   	return Ok(result.GetClientCommandResult());
}
Note: You can use a similar approach to bind our ASP.NET Core File Manager to a different cloud service.

Survey

If you’re currently using the DevExpress ASP.NET File Manager control and expect to use Azure in an upcoming project, we’d love to hear from you. Please share your experiences with us below.

Viewing all 398 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>