The requested page is not available for the requested platform. You are viewing the content for Default platform.

View.SelectionChanged Event

Occurs after changing a View's selected objects.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.1.dll


public event EventHandler SelectionChanged
Public Event SelectionChanged As EventHandler

Event Data

The SelectionChanged event handler receives an argument of the EventArgs type.


This event is raised in methods of the View class descendants:

The example below demonstrates how to change a SimpleAction's caption when the selected object changes.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using MainDemo.Module.BusinessObjects;
// ...
public class ActionCaptionController : ViewController {
    private SimpleAction objectAction;
    private void UpdateActionCaption() {
        objectAction.Caption = CalculateActionCaption();
    private string CalculateActionCaption() {
        Contact currentObject = (Contact)View.CurrentObject;
        if(currentObject != null) {
            return currentObject.FullName;
        return "Object Action";
    private void View_SelectionChanged(object sender, EventArgs e) {
    protected override void OnActivated() {
        View.SelectionChanged += View_SelectionChanged;
    protected override void OnDeactivated() {
        View.SelectionChanged -= View_SelectionChanged;
    public ActionCaptionController() {
        TargetObjectType = typeof(Contact);
        objectAction = new SimpleAction(this, "ObjectAction", PredefinedCategory.Edit);

To run this code, add the DevExpress.ExpressApp.XtraGrid.v19.1.dll assembly to References.

See Also