Skip to main content
.NET 6.0+

XafApplication.ListViewCreated Event

Occurs after a List View is created.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<ListViewCreatedEventArgs> ListViewCreated

Event Data

The ListViewCreated event's data class is ListViewCreatedEventArgs. The following properties provide information specific to this event:

Property Description
ListView Specifies the List View to be customized in the XafApplication.ListViewCreated event.
View Specifies the View to be customized in the XafApplication.ViewCreated event. Inherited from ViewCreatedEventArgs.

Remarks

Handle this event to customize the ListView that the XafApplication.CreateListView method created. The ListViewCreatedEventArgs.ListView parameter specifies this List View.

The following example demonstrates how to handle this event in the MySolution.Win\Program.cs(.vb) file:

using System;
using DevExpress.ExpressApp;
// ...
public class Program {
   public static void Main(string[] arguments) {
      MySolutionWinApplication winApplication = new MySolutionWinApplication();
      //...
      winApplication.ListViewCreated += winApplication_ListViewCreated;
   }
   private static void winApplication_ListViewCreated(object sender, ListViewCreatedEventArgs e) {
      if (e.ListView.Id == "Person_ListView"){
         e.ListView.CreateCustomCurrentObjectDetailView += 
            new EventHandler<CreateCustomCurrentObjectDetailViewEventArgs>(
            ListView_CreateCustomCurrentObjectDetailView);
      }
   }
   private static void ListView_CreateCustomCurrentObjectDetailView(object sender, 
         CreateCustomCurrentObjectDetailViewEventArgs e) {
      e.DetailViewId = "MyCustomDetailView";
   }
}
See Also