Skip to main content
All docs
V23.2
.NET 6.0+
  • The page you are viewing does not exist in the .NET Framework 4.5.2+ platform documentation. This link will take you to the parent topic of the current section.

DxGridListEditor.UnselectObjects(IEnumerable) Method

Deselects a set of specified objects.

Namespace: DevExpress.ExpressApp.Blazor.Editors

Assembly: DevExpress.ExpressApp.Blazor.v23.2.dll

NuGet Package: DevExpress.ExpressApp.Blazor

Declaration

public void UnselectObjects(
    IEnumerable objectsToUnselect
)

Parameters

Name Type Description
objectsToUnselect IEnumerable

A collection of objects to deselect.

Remarks

The code sample below demonstrates how to create a simple action that deselects records that satisfy custom criteria within a List View:

File:
MySolution.Blazor.Server\Controllers\MySelectController.cs in solutions without the ASP.NET Core Blazor-specific module project. MySolution.Module.Blazor\Controllers\MySelectController.cs in solutions with the ASP.NET Core Blazor-specific module project.

using DevExpress.Data.Filtering;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Blazor.Editors;
using DevExpress.Persistent.Base;
using MySolution.Module.BusinessObjects;
using System;
// ...
public class MySelectController : ObjectViewController<ListView, DemoTask> {
    public MySelectController() {
        SimpleAction unselectLowPriorityTasksAction = new SimpleAction(this, "UnselectLowPriorityTasksAction", PredefinedCategory.View) {
            Caption = "Unselect Low Priority Tasks",
            SelectionDependencyType = SelectionDependencyType.RequireMultipleObjects,
            TargetViewNesting = Nesting.Root
        };
        unselectLowPriorityTasksAction.Execute += UnselectLowPriorityTasksAction_Execute; ;
    }

    private void UnselectLowPriorityTasksAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
        if(View.Editor is DxGridListEditor gridListEditor) {
            gridListEditor.UnselectObjects(
                ObjectSpace.GetObjects<DemoTask>(
                    CriteriaOperator.FromLambda<DemoTask>(task => task.Priority == Priority.Low)
                )
            );
        }
    }
}
See Also