GridListEditor.SelectObject(Object) Method
Selects a specified object.
Namespace: DevExpress.ExpressApp.Blazor.Editors.Grid
Assembly: DevExpress.ExpressApp.Blazor.v20.2.dll
NuGet Package: DevExpress.ExpressApp.Blazor
Declaration
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.Grid;
using DevExpress.Persistent.Base;
using MySolution.Module.BusinessObjects;
using System;
namespace MySolution.Module.Controllers {
public class MySelectController : ObjectViewController<ListView, DemoTask> {
public MySelectController() {
SimpleAction selectCurrentTaskAction = new SimpleAction(this, "SelectCurrentTaskAction", PredefinedCategory.View) {
Caption = "Select a Due Today Task",
SelectionDependencyType = SelectionDependencyType.Independent,
TargetViewNesting = Nesting.Root
};
selectCurrentTaskAction.Execute += SelectCurrentTaskAction_Execute; ;
}
private void SelectCurrentTaskAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
if(View.Editor is GridListEditor gridListEditor) {
gridListEditor.SelectObject(ObjectSpace.FirstOrDefault<DemoTask>(task => task.DueDate == DateTime.Today));
}
}
}
}
See Also