Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET 5.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.
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

DxGridListEditor.UnselectObject(Object) Method

Deselects a specified object.

Namespace: DevExpress.ExpressApp.Blazor.Editors

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

NuGet Package: DevExpress.ExpressApp.Blazor

Declaration

public void UnselectObject(
    object objectToUnselect
)

Parameters

Name Type Description
objectToUnselect Object

An object to deselect.

Remarks

The code sample below demonstrates how to create a simple action that deselects a record within a List View. The action is available only when a single item is selected.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Blazor.Editors;
using DevExpress.Persistent.Base;
using MySolution.Module.BusinessObjects;

namespace MySolution.Module.Blazor.Controllers {
    public class MySelectController : ObjectViewController<ListView, DemoTask> {
        public MySelectController() {
            SimpleAction unselectTaskAction = new SimpleAction(this, "UnselectTaskAction", PredefinedCategory.View) {
                Caption = "Unselect a Task",
                SelectionDependencyType = SelectionDependencyType.RequireSingleObject,
                TargetViewNesting = Nesting.Root
            };
            unselectTaskAction.Execute += UnselectTaskAction_Execute; ;
        }

        private void UnselectTaskAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
            if(View.Editor is DxGridListEditor gridListEditor) {
                var selectedObjects = gridListEditor.GetSelectedObjects();
                if(selectedObjects.Count == 1) {
                    gridListEditor.UnselectObject(selectedObjects[0]);
                }
            }
        }
    }
}
See Also