Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XafApplication.ListViewCreated Event

Occurs after a List View is created.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.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