Back to Devexpress

XafApplication.ListViewCreated Event

expressappframework-devexpress-dot-expressapp-dot-xafapplication-c836dc9b.md

latest3.2 KB
Original Source

XafApplication.ListViewCreated Event

Occurs after a List View is created.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public event EventHandler<ListViewCreatedEventArgs> ListViewCreated
vb
Public Event ListViewCreated As EventHandler(Of ListViewCreatedEventArgs)

Event Data

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

PropertyDescription
ListViewSpecifies the List View to be customized in the XafApplication.ListViewCreated event.
ViewSpecifies 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 file:

csharp
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

XafApplication Class

XafApplication Members

DevExpress.ExpressApp Namespace