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

WinForms — Early Access Preview (v25.1)

$
0
0

Our next major update (v25.1) is a couple of months away. As such, we wanted to preview a few features/capabilities we expect to ship this spring 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, new desktop development standards (.NET Core, AI, Accessibility) remain 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 v25.1 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 June 2025 Roadmap.

AI–driven Semantic Search within the WinForms Data Grid

Our WinForms Data Grid will ship with an enhanced search experience and allow users to locate relevant data within large datasets faster/more accurately. The Data Grid utilizes Natural Language Processing (NLP) to analyze search queries beyond exact keyword matching. By interpreting synonyms and contextual meaning, the DevExpress Data Grid will deliver more precise search results.

Once AI-driven semantic search is enabled, a dropdown button appears within the search box. The popup menu allows users to specify search mode: standard, semantic, or hybrid (a combination of standard and semantic search).

AI–Driven Semantic Search in the WinForms Data Grid, DevExpress

You can use semantic search in either 'Filter' or 'Search' mode. In 'Search' mode, the grid highlights relevant data rows for more flexible/intuitive data discovery:

AI–Driven Semantic Search in the WinForms Data Grid - Search Mode, DevExpress

Semantic search requires use of additional DevExpress NuGet packages:

  • DevExpress.AIIntegration.SemanticSearch
  • DevExpress.AIIntegration.WinForms.SemanticSearch

To enable AI–powered semantic search within the WinForms Data Grid, you must register an embedding generator, supply a vector storage/database, connect our new SemanticSearchBehavior to the grid, and configure behavior settings (such as, an embedding generator, vector store, record type in a vector store, data source key field, search mode, search accuracy, the maximum number of results, etc.):

WinForms Semantic Search Behavior Settings, DevExpress

The following code snippet initializes vectors. It creates an in-memory vector store to store vectorized records (for demo purporses). Production AI applications use vector databases and services to improve relevancy. You can use any vector store that implements the IVectorStore interface to store embeddings. Refer to the following topic for additional information: Available vector database solutions.


async void Form1_Shown(object sender, EventArgs e) {
    try {
        await Initialize();
    }
    catch(Exception ex) {
        MessageBox.Show(ex.ToString());
    }
}

// Define a record stored in the vector store for semantic search
class VectorStoreRecord {
    // A unique identifier for the record in a vector store
    [VectorStoreRecordKey]
    public string Key { get; set; }

    // Text content associated with the record
    [VectorStoreRecordData]
    public string ItemDescription { get; set; }

    // Numerical vector representation of the record
    // Specifies how vector data is stored and compared in a vector store
    // Ollama produces 768-dimensional vectors 
    [VectorStoreRecordVector(768, DistanceFunction.CosineSimilarity)]
    public ReadOnlyMemory<float> Vector { get; set; }
}

async Task Initialize() {
    // Initialize an embedding generator to convert text into numerical vectors
    // This example uses the Ollama embedding generator.
    var embeddingGenerator = new OllamaEmbeddingGenerator(new Uri("http://localhost:11434/"), "nomic-embed-text");
    
    /* The following code uses an Azure OpenAI embedding model.
    *  You can use the 'text-embedding-3-small' model that produces 1536-dimensional vectors.
    *  Modify the 'VectorStoreRecordVector' attribute for the 'VectorStoreRecord.Vector'.
    * var embeddingGenerator = new AzureOpenAIClient(
    *     new Uri(AzureOpenAIEndPoint),
    *     new AzureKeyCredential(AzureOpenAIKey))
    *     .AsEmbeddingGenerator(ModelId);
    */

    // Create an in-memory vector store to store vectorized records
    var vectorStore = new InMemoryVectorStore();

    // Retrieve the default AI container
    var container = AIExtensionsContainerDesktop.Default;
    
    // Register the embedding generator in the AI container
    container.AddEmbeddingGenerator(embeddingGenerator);

    // Register the vector store in the AI container
    container.AddVectorStore(vectorStore);

    // Create and populate the vector store with vectorized data items
    await container.CreateVectorStoreCollectionAsync<DataItem, VectorStoreRecord>(
        // Retrieve all items to be indexed
        dataSource: DataItem.GetAllItems(),
        // Specify the collection name in the vector store
        vectorStoreCollectionName: "DataItems",
        // Extract the text content from each item to be transformed into a vector
        vectorizableContentGetter: item => item.Name + " - " + item.Description);
}

JSON Serialization

DevExpress WinForms UI controls now support JSON-based layout serialization - an alternative to XML for simplified integration with modern web and AI services. With v25.1, a new SaveLayoutToJson(Stream) method allows you to save and restore control layout in JSON format.

JSON serialization is available for projects targeting .NET 8+ and .NET Framework 4.6.2+.

string filePath = "gridlayout.json";
void Form1_Load(object sender, EventArgs e) {
    if (File.Exists(filePath)) {
        using (var jsonStream = File.OpenRead(filePath))
            gridView.RestoreLayoutFromJson(jsonStream);
    }
}

void Form1_FormClosing(object sender, FormClosingEventArgs e) {
    using (var jsonStream = File.OpenWrite(filePath))
        gridView.SaveLayoutToJson(jsonStream);
}

Enhancements in WinForms Grid–based Controls

ItemsView – Data Validation

This EAP includes new ValidateRow and BeforeLeaveRow events in the ItemsView.

Adjust Horizontal Scrolling on Touchpad

DevExpress grid–based controls (such as GridControl, TreeList, Gantt Control, and VGridControl) support smooth scrolling with a touchpad. However, some users may experience inverted horizontal scrolling behavior when using a touchpad on Windows devices.

v25.1 introduces a new InvertHorizontalScrolling option that reverses current horizontal scrolling direction in our WinForms grid-based controls when using the touchpad.

static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    WindowsFormsSettings.InvertHorizontalScrolling = DefaultBoolean.True;
    Application.Run(new Form1());
}

WinForms Data Editors

WinForms Step Progress Bar - UX Enhancements

We improved the user experience for step–based navigation workflows. With v25.1, users can interact with StepProgressBar items as follows:

  • Click an item to select it.
  • Use arrow keys to move focus between items.
  • Press Enter or Space to select an item.
WinForms Step Progress Bar - UX Enhancements, DevExpressWinForms Step Progress Bar - Keyboard Accessibility, DevExpress

New StepProgressBar APIs include:

stepProgressBar1.AllowUserInteraction = true;
// ...
void StepProgressBar1_ItemClick(object sender, StepProgressBarItemClickEventArgs e) {
    if (IsDataSaved(e.Item)) return;
    if (XtraMessageBox.Show("You have unsaved changes. Would you like to save them?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
        e.Handled = true;
}

WinForms SearchLookUpEdit - Synchronized Find Panel Text

Our WinForms SearchLookUpEdit allows users to specify find panel text for the popup View, ensuring synchronization with the FindFilterText property. Previously, modifying the PopupView.FindFilterText property did not update the find panel's textbox, leading to inconsistencies in search behavior. This enhancement ensures that the find panel displays the actual filter applied.


searchLookUpEdit1.Properties.View.FindFilterText = "Mike";

WinForms MemoEdit - Auto Height within the Layout Control

Our WinForms MemoEdit control includes a new LayoutControlAutoHeightMode property. This property specifies how MemoEdit height adjusts to fit content when placed within a LayoutControl. Available auto height modes include:

  • Default / None: MemoEdit height remains fixed and does not adjust to content. A scrollbar appears if content exceeds available height.
  • GrowOnly: MemoEdit height increases to fit content but does not decrease when content is reduced.
  • GrowAndShrink: MemoEdit height increases or decreases automatically to fit content.
WinForms MemoEdit - Auto Height within the Layout Control, DevExpress

WinForms CheckedListBoxControl - Custom SVG Check Icon

Our WinForms CheckedListBoxControl now supports user defined (custom) SVG check icons. With v25.1, you can specify unique icons for checked, unchecked, and grayed item states. This enhancement supports customizations designed to match application themes/UI standards.

WinForms CheckedListBoxControl - Custom SVG Check Icon, DevExpress
checkedListBoxControl1.CheckStyle = CheckStyles.UserDefined;
checkedListBoxControl1.ImageOptions.SvgImageChecked = svgImageCollection1["checkedState"];
checkedListBoxControl1.ImageOptions.SvgImageUnchecked = svgImageCollection1["uncheckedState"];
checkedListBoxControl1.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);

WinForms TokenEdit - Advanced Mode

This EAP includes new APIs for our WinForms TokenEdit. With these APIS, you can customize the following advanced mode settings:

  • Caret Animation
  • Selection Animation
  • Selection Color Customization

Use the TokenEdit.Properties.AdvancedModeOptions property to access Advanced Mode settings:

// Enable Advanced Mode
tokenEdit.Properties.UseAdvancedMode = DefaultBoolean.True;
// Enable caret animation
tokenEdit.Properties.AdvancedModeOptions.AllowCaretAnimation = DefaultBoolean.True;
// Animate selection
tokenEdit.Properties.AdvancedModeOptions.AllowSelectionAnimation = DefaultBoolean.True;
// Set selection color
tokenEdit.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;

We also implemented a new QueryAdvancedMode static event. This event fires for every TokenEdit control in the project and allows you to configure Advanced Mode settings based on your preferences.

WinForms Ribbon and Bars

Maximize/Minimize Ribbon

New APIs include:

Identify Bar Items and Bar Links

New APIs include:

barManager1.ItemClick += (sender, e) => {
    BarItem item = barManager1.GetItemAt(Cursor.Position);
    // BarItemLink itemLink = barManager1.GetLinkAt(Cursor.Position);
    Debug.WriteLine(item.Caption);
};

Handle Bar Item Right-Clicks

The WinForms Bar Manager and Ribbon Control will support right-click handling for bar items. New events include:

We also introduced a new e.MouseButtton event parameter that allows you to identify the pressed mouse button.

Mnemonic-Based Submenu Navigation

With v25.1, we enhanced keyboard accessibility for traditional Toolbar-based user interfaces. Users can cycle through submenu items with the same mnemonic (denoted by & in captions). When multiple items within a submenu have identical mnemonics, repeated key presses navigate through them sequentially. The feature is automatically enabled and does not require additional configuration.

Mnemonic-Based Submenu Navigation, DevExpress
barItemSaveAs.Caption = "Save &As";
barItemSaveAll.Caption = "Save &All";

BarItem - Support for AutomationId

The AutomationId property - a unique identifier that distinguishes UI elements in automated tests and accessibility (a11y) tools - is now available for BarItem objects. This property is automatically set to the bar item's Name.

BarToggleSwitchItem - Toggle Switch Width

With v25.1, you can specify a toggle switch bar item width. Use the EditorToThumbWidthRatio property to set the item's total width relative to the width of the thumb.

BarToggleSwitchItem - Toggle Switch Width, DevExpress

WinForms Accordion Control

Badges and Hints

We integrated our WinForms Accordion Control with the Adorner UI Manager to help display badges/hints and highlight specific Accordion UI elements.

WinForms Accordion Control - Badges and Hints, DevExpress
using System.Drawing;
using DevExpress.Utils.VisualEffects;
// ...
Badge badgeInbox;
public Form1() {
    InitializeComponent();
    badgeInbox = new Badge();
    // Assign the badge to the 'Inbox' accordion item
    badgeInbox.TargetElement = accordionItemInbox;
    // Specify badge text
    badgeInbox.Properties.Text = "17";
    // Specify badge location and offset
    badgeInbox.Properties.Location = ContentAlignment.TopLeft;
    badgeInbox.Properties.Offset = new Point(85, 6);
    // Customize badge appearance
    badgeInbox.Appearance.BackColor = Color.Gray;
    badgeInbox.Appearance.BorderColor = Color.Gray;
    badgeInbox.Appearance.ForeColor = Color.White;
    badgeInbox.Appearance.Font = new Font("Tahoma", 8.25F, FontStyle.Bold);

    // Add the badge to the AdornerUIManager
    adornerUIManager1.Elements.Add(badgeInbox);
}

Shortcuts

Accordion items now support keyboard shortcuts. Use the ShortcutKey property to specify a predefined or custom keyboard shortcut. This enhancement improves accessibility, especially for applications with complex navigation structures.

XtraMessageBox Enhancements

v25.1 introduces new functionality designed to:

  • Display the DevExpress Message Box in the Windows Taskbar, ensuring it is easily accessible to users.
  • Define the start position of the Message Box on screen.
void messageButton_Click(object sender, EventArgs e) {
    XtraMessageBoxArgs args = new XtraMessageBoxArgs() {
        Caption = "Tip",
        Text = "Hello DevExpress!",
        Buttons = new DialogResult[] { DialogResult.OK },
    };
    args.ImageOptions.SvgImage = svgImageCollection1["info"];
    args.ImageOptions.SvgImageSize = new Size(32, 32);
    args.Showing += Args_Showing;
    XtraMessageBox.Show(args);
}
void Args_Showing(object sender, XtraMessageShowingArgs e) {
    // Get the screen working area
    Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

    // Calculate bottom-right position
    int x = workingArea.Right - e.MessageBoxForm.Width;
    int y = workingArea.Bottom - e.MessageBoxForm.Height;
            
    // Define message box start position 
    e.MessageBoxForm.StartPosition = FormStartPosition.Manual;
    e.MessageBoxForm.Location = new Point(x, y);

    // Display the message box in the Windows taskbar
    e.MessageBoxForm.ShowInTaskbar = true;
}

Your Feedback Counts

If you have a specific question about our WinForms EAP (v25.1), feel free to submit a support ticket via the DevExpress Support Center. We will be happy to follow-up. 

For additional information on what you can expect, refer to our June 2025 Roadmap (you can also leave your feedback at the end of the article).


Viewing all articles
Browse latest Browse all 2388

Trending Articles