Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2370

WinForms — Early Access Preview (v24.2)

$
0
0

Our next major update (v24.2) is a couple of months away. As such, we wanted to preview the features we expect to ship this winter and invite all active DevExpress Universal or DXperience subscriber to download and install our Early Access Preview (EAP) today (visit the DevExpress Download Manager to obtain the EAP build). As you will see below, the new desktop development standards (.NET Core, Security, Accessibility, AI) will continue to remain our key focus areas.

Early Access and CTP builds are provided solely for early testing purposes and are not ready for production use. This build can be installed side by side with other major versions of DevExpress products. Please backup your project and other important data before installing Early Access and CTP builds.

This EAP may not include all features/products we expect to ship in our v24.2 release cycle. As its name implies, the EAP offers an early preview of what we expect to ship in two months. For additional information on what you can expect, refer to our Year-End 2024.2 Roadmap.

.NET Core / .NET

.NET 9 Support

The DevExpress WinForms product line now supports NET 9 RC1 .

.NET 8, .NET Framework 4.6.2, Visual Studio 2019 Will Be Minimally Supported Versions for DevExpress Libraries (v24.2+)

Learn more about this global change in this announcement.

Easier Upgrade to .NET from .NET Framework

Our Project Converter can now convert DevExpress assembly references in your solution or specific projects to corresponding DevExpress NuGet packages. By selecting the "Convert DevExpress assembly references to NuGet packages" option under Advanced settings, you can easily transition to NuGet-based project management.

DevExpress Project Converter v24.2

To streamline the upgrade process, our Project Converter automatically creates backup (.bak) files for your CSPROJ and VBPROJ files. Once DevExpress assemblies are converted, complete the upgrade process by using the Microsoft .NET Upgrade Assistant (to migrate your application to the most recent version of .NET).

Documentation:  Migrate a .NET Framework App to .NET  |  Choose Suitable NuGet Feed  |  Install NuGet Packages in IDE 

Enhanced UX with the WinForms .NET Core Designer

We've optimized the way we load DevExpress NuGet packages and skins to improve form load performance within Visual Studio’s .NET/.NET Core WinForms Designer. This improves startup load time by 20-35% (when compared to v24.1). Performance enhancements are most noticeable for complex projects.

The following internal test results illustrate performance improvements we've made in this release cycle:

v24.2 (ms)v24.1 (ms)
Test #1
Win.Grid NuGet package
A form with Ribbon and Data Grid controls.
2,4243,929
Test #2
Win.Design NuGet package
A form with Ribbon and Scheduler controls.
3,1214,743

Documentation:  Install a Unified NuGet Package vs Atomic (Control-Specific) NuGet Packages with Design-Time Support 

TimeOnly Support in the WinForms TimeEdit

The WinForms TimeEdit control now supports the TimeOnly data type and incorporates a TimeOnly mask within the Mask Settings editor.

TimeOnly Support in the WinForms TimeEdit

New TimeOnly Functions

This EAP adds new TimeOnly-specific criteria functions to our criteria language and Grid-based UI controls (Data Grid, Vertical Grid, TreeList).

New TimeOnly functions include:

  • BeforeMidday - Filters records that occur before 12:00 PM.
  • AfterMidday - Filters records that occur after 12:00 PM.
  • ThisHour - Filters records that occur during the current hour.
  • NextHour - Filters records that occur during the next hour.
  • LastHour - Filters records that occurred during the previous hour.
  • IsMorning - Filters records that occur between 6:00 AM and 12:00 PM.
  • IsAfternoon - Filters records that occur between 12:00 PM and 6:00 PM.
  • IsEvening - Filters records that occur between 6:00 PM and 9:00 PM.
  • IsNight - Filters records that occur between 9:00 PM and 6:00 AM.
  • IsWorkTime - Filters records that occur during work hours (9:00 AM to 5:00 PM).
  • IsFreeTime - Filters records that occur outside of work hours (9:00 AM to 5:00 PM).
  • IsLunchTime - Filters records that occur during lunch time (12:00 PM to 1:00 PM).
  • IsSameHour - Filters records that occur exactly at the specified hour (e.g., 2 PM).
  • IsSameMinute - Filters records that occur exactly at the specified hour and minute (2:35 PM).
  • TimeOnlyFromParts - Returns the time value for the specified time with a specified precision (hour, minute, [seconds], [milliseconds]).

Applies to:

  • Criteria Operators
  • Filtering UI (Column Filter Popup, Filter Editor)
  • Expression Editor
  • Conditional Formatting Rules
  • Unbound Columns

You can use these new TimeOnly functions in your DevExpress-powered .NET and .NET Framework Windows Forms applications.

Documentation

TimeOnly Range Filter within the Filter Popup

The Excel-Style Column Filter ships with a new Time Range Editor (by default). In addition to traditional date filtering options, users can now filter records based on specific time intervals (such as hours, minutes, or custom time ranges).

Features include:

  • Full-Day Coverage: The Time Range Editor allows users to specify a From/To range that spans the entire day (00:00 to 23:59).
  • Track-Bar Sliders: Users can use intuitive track-bar sliders to modify time range values.
  • Text Editors with Time Mask: Range selectors are accompanied by text editors that utilize a TimeOnly mask (passed from column editor settings).
  • Fine-Grained Control: The minimum step for modifying slider values is set to a 5-minute interval (offering a balance between ease of use and precision). Users can enter an exact time within text editors.
  • Tooltips for Visual Feedback: To enhance usability, tooltips appear over sliders as users modify time range values.
TimeOnly Range Filter in Filter Popup

Use the following code for backward compatibility:

ExcelFilterOptions.Default.PreferredTimeValuesTabFilterType = ExcelFilterOptions.TimeValuesTabFilterType.Tree;

Minute Rounding for TimeOnly Values

Within all DevExpress Filtering UIs (including Column Filter Popups and the Filter Editor), TimeOnly values are rounded to minutes, ignoring seconds and milliseconds.

On the UI side, we automatically simplify interval-based criteria into a more readable format within the Filter Panel and AutoFilter Row. For instance, a condition like [Time] >= 7:44 and [Time] < 7:45 is visually condensed to [Time] = 7:44. This representation enhances the user experience by removing unnecessary time components, such as seconds and milliseconds (often irrelevant for everyday use cases).

Guidance on New Desktop Development Standards

The architecture of desktop/Windows-based applications has shifted significantly over the last few years - from straightforward two-tier "client/server" models to distributed systems. This shift places new demands on how developers design, secure, and optimize applications:

  • Backend and Frontend Separation
  • Increased Complexity in Data Persistence
  • Asynchronous UI Clients (Frontend)

To help guide our loyal WinForms/WPF/VCL/.NET MAUI/XAF customers through new/tightened security requirements (and associated complexities) for Windows desktop application development, we've written a series of blog posts, docs and created associated demo applications:

  1. Modern Desktop Apps and Their Complex Architectures
  2. Share Code Between Desktop (WinForms/WPF) and Mobile (.NET MAUI) Projects (Blog Post)
  3. Connect a .NET Desktop Client to a Secure Backend Web API Service (EF Core + OData) (Download Demo)
  4. Connect a WinForms Data Grid to an Arbitrary ASP.NET Core WebAPI Service Powered by EF Core (Download Demo)
  5. Tips & Tricks / FAQ on .NET / .NET Core Support and Migration from .NET Framework
  6. NuGet Security, Licensing, and Troubleshooting Best Practices
  7. Install NuGet Packages in Visual Studio, VS Code, and Rider / Install NuGet Packages in CI/CD (GitHub Actions, GitLab, Azure DevOps)

Artificial Intelligence (AI)

Common

DevExpress AI-powered APIs allow you to integrate the following AI services into your DevExpress-powered WinForms application:

  • OpenAI
  • Azure OpenAI
  • Ollama

AI services and DevExpress AI extensions (behaviors) follow a "bring your own key" approach. DevExpress does not provide a REST API or include built-in LLMs/SLMs. To use AI services, you need an active Azure/OpenAI subscription to obtain the necessary REST API endpoint, key, and model deployment name. This information must be provided at application startup to register AI clients and enable DevExpress AI-powered features in your WinForms application.

The following code snippet registers an Azure OpenAI client:

using Azure.AI.OpenAI;
using DevExpress.AIIntegration;

internal static class Program
{
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        AIExtensionsContainerDesktop.Default.RegisterChatClientOpenAIService(
            new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)),
            deploymentName: DeploymentName
        );
        Application.Run(new Form1());
    }
    static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"); } }
    static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } }
    static string DeploymentName { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENTNAME"); } }
}

Review the following help topic for additional information on prerequisites, installation guidelines, and AI client registration processes: DevExpress AI-Powered Extensions for WinForms.

AI-Powered Smart Paste

Smart Paste is an AI-ready feature that transforms traditional copy-paste operations. Designed to improve productivity, Smart Paste analyses copied content and intelligently assigns correct values to appropriate fields/row cells in the DevExpress Data Grid and Layout Control-powered forms.

When Smart Paste is activated, the "Smart Paste" command is automatically added to a control's popup menu. When a user copies data from a source (such as a spreadsheet, document, or web page) and pastes it into a Data Grid or Layout Control-powered form, Smart Paste automatically interprets content and maps the data to the correct data fields or cells.

AI-driven Smart Paste - DevExpress WinForms Layout Control

Review the following help topic for additional information and examples, including how to register an AI-related client and configure Smart Paste behaviors: AI-powered Smart Paste

AI-Powered Smart Search

DevExpress WinForms Ribbon and Accordion controls now support AI-powered smart search. Smart Search works alongside traditional search algorithms to deliver a more powerful and user-friendly search experience. 

When the user pauses text entry in the search field (within the Ribbon or Accordion control), the control sends the current search query to an AI service that understands context, synonyms, and user intent beyond exact keyword matches. Once the AI service returns results, the control filters items accordingly.

AI-Powered Text Processing

NLP-powered text transform extensions (behaviors) allow you to enhance the way users interact with and manage text content. These extensions leverage advanced natural language processing (NLP) technologies to provide automated, intelligent text manipulation capabilities directly within your Windows Forms applications.

AI-powered text transform extensions include:

  • Expand
  • Explain
  • Explain Formular (in the Spreadsheet control)
  • Shorten
  • Summarize
  • Adjust Tone
  • Proofread
  • Rewrite
  • Translate
  • Ask AI (Custom Prompt)

AI-powered text transform extensions can be used in the following DevExpress WinForms controls:

  • MemoEdit
  • Rich Text Editor
  • Spreadsheet

To add this capability in your DevExpress-powered WinForms app, simply drop the DevExpress Behavior Manager component from the Toolbox onto a Form, add required AI-powered text transform behaviors in the Behavior Editor, attach behaviors to DevExpress controls, and configure behavior settings as needed:

AI-Powered Text Transform Behaviors

Run the application, select text, invoke the popup menu, and click the appropriate AI-related command. AI will process the command and generate an answer. The AI-generated answer will be displayed within a dialog.

You can insert the answer directly into a document or text field with a single click. You can insert the answer above/below selected text or cursor, replace all content or selected text, or copy the answer to the clipboard.

CustomRequestBehavior displays an "Ask AI" item in the context menu. "Ask AI" invokes a dialog and allows users to directly interact with an AI-powered assistant. A user can enter a question or prompt. The AI assistant will process the query and generate an answer.

Ask AI in DevExpress WinForms Controls

Review the following help topic for additional information: AI-Powered Text Transform Extensions.

AI-Powered Behaviors in Rich Text and Spreadsheet Editors for WinForms

Please review the following blog post for more information: Office-Inspired Controls (WinForms & WPF) — Early Access Preview (v24.2) — AI-Powered Behaviors and Accessibility Enhancements.

Accessibility and Globalization

Keyboard Navigation between Toolbars

Users can now switch between toolbars using the Ctrl+Tab keyboard shortcut.

When/if a Main Menu is not included in an application, set the Bar Manager's AllowFocusBarWithoutMainMenu property to true to enable keyboard navigation between toolbars.

Accessibility Enhancements - Alt Text Dialogs

In v24.2, we implemented new AI-Powered Alt Text dialogs for WinForms Rich Text Editors and Spreadsheet Controls.
The Alt Text dialog allows you to set accessible descriptions for shape objects in Word and Excel documents or mark non-informative document graphics as Decorative (this setting allows screen readers to ignore decorative graphics when scanning documents).
In addition, you can use the Alt Text dialog to generate the meaningful descriptions for document images using the power of the AI behavior. To enable this functionality, follow the steps from the previous section of the current blog post to register the AI service and then, attach the DevExpress.AIIntegration.WinForms.GenerateDescriptionBehavior behavior for RichEditControl or SpreadsheetControl in a WinForms application.

The Generate button is disabled if the GenerateDescriptionBehavior isn't registed for Rich Text Editor or Spreadsheet Control. Descriptions can be generated only for document images. The Generate option is disabled when a shape or chart object is selected.

The new built-in dialogs are available from the shape’s context menu. To activate the Alt Text dialog, select a document shape, or image, or chart, open the context menu and click the “View Alt Text…” context menu item.

WinForms Scheduler Enhancements

Reminder Form – New 'RemindersFormAction' Event

This EAP ships with a new WinForms Scheduler RemindersFormAction event. The event occurs when a user clicks the Dismiss, Dismiss All, or Snooze button on Reminders Forms (or if the user closes the form).

Reminder Form - WinForms Scheduler, DevExpress

Use the e.ActionType event parameter to obtain the user action that triggered the event. For example, you can display personalized notifications when users take specific actions, or you can cancel the default action by setting the e.Handled parameter to true and execute custom logic as necessary.

Resources Tree – Auto-Populate Columns

Once the Resources Tree component is added to a Form that includes a DevExpress Scheduler control, the Resources Tree component automatically generates columns based on resource mappings configured in the underlying data storage. This enhancement reduces manual setup and ensures that the Resources Tree immediately reflects the resource structure defined for the schedule.

This EAP also includes a "Generate Columns" command in the Resources Tree's smart tag menu. This command allows you to quickly refresh columns. It clears existing columns and repopulates them based on resource mappings.

To enhance runtime flexibility, we also added a PopulateColumns method. This method auto-generates Resources Tree columns. The PopulateColumns method clears the ResourcesTree.Columns collection, creates new columns, binds them to corresponding data fields, and adds columns to the collection.

WinForms Report Viewer and Designer

New Aztec Barcode

We extended barcode support and now allow you to generate the Aztec code. Aztec barcodes offer a compact/efficient way to encode large amounts of data without requiring a quiet zone, making them ideal for space-constrained documents.

To create the Aztec Barcode, set the XRBarCode.Symbology property value to AztecCode and specify appropriate barcode properties:

DevExpress Report Designer — Aztec Barcode

You can also specify barcode data using Text or BinaryData properties as follows:

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...

XRBarCode barCode = new XRBarCode();
barCode.Symbology = new AztecCodeGenerator();
barCode.Text = "YourData";
//OR
//barCode.BinaryData = GetAztecCodeData();

New Micro QR Code

You can now create Micro QR Codes (a smaller alternative to traditional QR Codes). Micro QR Codes are suitable for space-limited documents, where only small amounts of data (35 characters or 128 bits) require encoding.

To create a Micro QR Code, set the XRBarCode.Symbology property value to MicroQRCode and specify appropriate barcode properties:

DevExpress Report Designer — Micro QR Code

You can also specify barcode data using Text or BinaryData properties as follows:

using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...

XRBarCode barCode = new XRBarCode();
barCode.Symbology = new MicroQRCodeGenerator();
barCode.Text = "123ABC";
//OR
//barCode.BinaryData = GetMicroCodeData();

HTML Export — Preserve Rotated Text

The XRLabel control now preserves text rotation defined by its Angle property (supported angles are 90 degrees, 180 degrees, and 270 degrees, and their negative counterparts) when exporting reports to HTML files.

PDF Export — Export Bookmarks

The new PdfExportOptions.ExportBookmarks property allows you to control bookmark visibility in exported PDF documents.

Resolve Missing Fonts

We added a new DXFontRepository.QueryNotFoundFont event for fonts used within a document but missing in an application’s hosting environment. This feature allows you to identify and resolve missing fonts by adding them to DXFontRepository before document generation begins (using the e.FontFileData event argument). In the following code snippet, we use Google Fonts to locate/add fonts to DXFontRepository :

DXFontRepository.QueryNotFoundFont+= QueryNotFoundFont;

void QueryNotFoundFont(object sender, NotFoundFontEventArgs e) {
    var service = new FontCollectorService();
    var fontData = service.ProcessFont(e.RequestedFont).Result;
    e.FontFileData = fontData;
}

With this enhancement, you will be able to identify and address document appearance issues, ensuring that reports appear as designed, regardless of the hosting platform.

Our components will also log font names in the application output for debugging purposes. Please review the following example for additional information: Reporting for WinForms - Add missing fonts into DXFontRepository from Google.

Duplicate Conditional Formatting Rules in WinForms Data-Bound Controls

Duplicate Rules allows you to duplicate existing conditional formatting rules at both runtime and design time (to simplify reuse or modify rules without recreating them from scratch). 

"Duplicate Rules" is available in the following DevExpress WinForms controls:

  • Data Grid
  • PivotGrid
  • TreeList
  • Vertical Grid

You can use the Visual Studio Designer to duplicate existing rules with just a few clicks. This makes it easier to create variations of conditional formatting rules for different columns/rows/fields. 

Duplicate Conditional Formatting Rules at Design Time - DevExpress WinForms Data Grid

And yes, users can also duplicate conditional format rules at runtime:

Duplicate Conditional Formatting Rules at Runtime - DevExpress WinForms Data Grid

Security Enhancements

Environment Policy

We added a new Environment Policy that allows you to apply global environment access restrictions, track app-initiated requests (initiated by a DevExpress UI control) and execute custom actions in response.

You can apply global restrictions using various methods like SuppressAll() to block all environment access or more specific options such as preventing DevExpress UI controls from reading or writing environment variables, exiting processes, altering the current directory, or reading paths to system special folders.

Event handlers allow you to track and manage environment operations. For example, you can detect when DevExpress UI controls attempt to read or modify environment variables, process data, or system directories and enable conditional responses based on specific conditions.

Documentation

Registry Access Policy

DevExpress UI controls can save, read, and modify configuration settings and options in the system registry. These requests can be initiated in code or through the internal control engine. The Registry Access Policy allows you to apply global registry access restrictions, track user/app-initiated requests, and execute custom actions in response.

Documentation

Your Feedback Matters

We value your thoughts/feedback. Please take a minute to respond to the following question and let us know how we can best serve your WinForms-related development needs now and into the future: 

If you have yet to review the features/capabilities introduced in our most recent major update (v24.1), please visit the following webpage and let us know what you think of this release by responding to our online WinForms v24.1 survey.


Viewing all articles
Browse latest Browse all 2370

Trending Articles