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.SelectObject(Object) Method

Selects a specified object.

Namespace: DevExpress.ExpressApp.Blazor.Editors

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

NuGet Package: DevExpress.ExpressApp.Blazor

Declaration

public void SelectObject(
    object objectToSelect
)

Parameters

Name Type Description
objectToSelect Object

An object to select.

Remarks

The code sample below demonstrates how to create a simple action that selects an object that satisfies custom criteria within a List View:

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

namespace MySolution.Module.Blazor.Controllers {
    public class MySelectController : ObjectViewController<ListView, DemoTask> {
        public MySelectController() {
            SimpleAction selectCurrentTasksAction = new SimpleAction(this, "SelectCurrentTasksAction", PredefinedCategory.View) {
                Caption = "Select Due Today Tasks",
                SelectionDependencyType = SelectionDependencyType.Independent,
                TargetViewNesting = Nesting.Root
            };
            selectCurrentTasksAction.Execute += SelectCurrentTasksAction_Execute; ;
        }

        private void SelectCurrentTasksAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
            if(View.Editor is DxGridListEditor gridListEditor) {
                gridListEditor.SelectObject(ObjectSpace.FirstOrDefault<DemoTask>(task => task.DueDate == DateTime.Today));
            }
        }
    }
}
See Also