How to display a custom Detail View along with the List View when the split layout is activated

XAF Team Blog
29 July 2011

Split layout for List View

When the split layout is activated, the Detail View is displayed, together with the List View, in the same window. The detail View displays the currently selected object properties. The Detail View content changes dynamically, depending on the current object focused in the List View. This functionality is quite common for desktop applications. For instance, you will notice it in Microsoft Outlook (which I personally love and use a lot). Microsoft Access also offers the same option:

The beauty of this mode is that you can see record details within a single screen and are not be required to open a separate form. It is especially useful when you're using a List View with lots of records, to view and edit data. I imagine that you might also be using this mode for the same reason, correct?

So, XAF also provides this functionality out of the box (though it is currently available for Windows Forms applications only). If you are interested in learning more about this mode, please check out respective docs or play with the Main Demo application, demonstrating it.

If you think that it will also be useful for the Web, please describe these business scenarios, or provide links to other Web applications/screenshots, demonstrating this in action. We would love to learn more about it. You can put your feedback either in comments to this blog or in the corresponding suggestion in the Support Center.

Displaying short and full record details

If you are using the split layout (though it is called ListViewAndDetailView in XAF) mode, it is often convenient to distinguish modes when object details are shown along with the List View or when you open a separate window for editing. In the first case, I would be fine seeing short details:

ShortDetailView

and I would like to see full details and be able to do everything with my data in the latter case:

LongDetailView

Take special note that the Roles, Permissions and Phone Numbers collection, and some other properties are presented only in the latter Detail View.

In the current version, it is very easy to do in code. Just create a ViewController for a required List View (or for all of them), override its OnActivated method and subscribe to the ListView.CreateCustomCurrentObjectDetailView event. Provide an identifier of a custom Detail View in it. Or, you can do this globally for all List Views in your application as described here. That’s it.

It becomes even easier in 11.2…

And, I have good news for those who like customizing via the Model Editor. I have added a new MasterDetailView property for the List View model element, and now you are able to perform the task above by setting only this property:

MasterDetailView

I actually used this approach to produce the screenshots above.

You may wonder why could not I use the existing DetailView attribute, but the problem with it is that if you specify a custom detail form with that attribute, it will be used everywhere for this ListView. As a result, you will not be able to specify different views for master detail mode and for regular mode.

Paradise for customizations and extensions

XAF is very flexible by nature, and it allows customizing literally everything it creates for you. Of course, split layout mode is not exception. For instance, if you would like to learn more on how to extend standard model elements with your own options (similar to what I demonstrated above), be sure to check out a wonderful Extend and Customize the Application Model in Code article in our docs.

Also, I think that the customization above is a good demonstration of two great XAF features among many others:

  • A great set of out-of-the-box features that are needed for modern LOB applications and addressing most common business needs of your clients;
  • Flexibility and extensibility – no one limits you and you are able to customize everything in your application, either in code, application model designers or using other standard and XAF-specific customization approaches.

There are of course more various customization options available in XAF. To quickly learn more about them, be sure to check out the following sections in our docs:

They contain a lot of useful information as well as the respective training videos and webinar recordings on our TV channel. If you experience any difficulty customizing XAF to implement your custom business tasks, feel free to contact our Support Team. We will be happy to help you.

Give us your feedback!

Please let us know whether you like this small improvement and blog post in general.

Also, as always, I would love to hear about your own XAF experiences - What do you like in XAF the most?

If you are not yet using XAF, then I would be grateful to hear whether you are considering it for your projects.

Thank you for all the feedback in advance. And happy XAFingWinking smile

10 comment(s)
Vyacheslav Maximov
Vyacheslav Maximov

Nice one, thanks

29 July, 2011
James Zhong
James Zhong

Good! If Web.UI can support this split layout, that will be even better!

Web.UI is very good, but should support Ajax widely to reduce UI refresh.

Thank you for your effort to make XAF better!

29 July, 2011
Kim_Schmidt
Kim_Schmidt

Yeah your right Dennis: XAF's flexibility allowed to implement this by myself, without many problems.

So in future I can use your model property, that's even better ...  I don't have to maintain my custom feature anymore :).

1 August, 2011
Dennis (DevExpress)
Dennis (DevExpress)

Thank you for your comments, guys!

@James: If you think that the split layout functionality will also be useful for the Web, please describe some usefull business scenarios for it, or provide links to other Web applications/screenshots, demonstrating this in action. Thank for your time in advance!

As for more "ajaxy" Web UI, we are relentlessly working on implementing this feature and hopefully, if all goes according to plan, it will be released in 11.2. We will keep you informed of our progress.

1 August, 2011
James Zhong
James Zhong

@Dennis: Really good news for the first Ajaxy Web UI in XAF, possible to be released in 11.2 ! Thank you for your great work!

:)

2 August, 2011
Dennis (DevExpress)
Dennis (DevExpress)

@James: Thank you for the feedback!

BTW, what about ListViewAndDetailView on the Web (see my previous reply)?

3 August, 2011
Robert Fuchs
Robert Fuchs

@Dennis

Could you please explain how to open another (different) DetailView when the end-user clicks on "New"?

There are 2 possible scenarios:

1) Open a special Detailview for new objects ("New" action)

2) Run a wizard for new objects

Thank you, Robert

19 August, 2011
Salam
Salam

Hello Dennis,

          How can I implement it on Web, because I have already enabled the keyboard support for the ListView. So I want the focused row to be shown in the DetailView on the same page.

Could you please give me a solution?

30 November, 2012
Kurt ...
Kurt ...

How can i set the Property MasterDetailMode.ListViewAndDetailView at runtime (Windows Forms) ?

8 March, 2019
Dennis (DevExpress)
Dennis (DevExpress)

Please login or register to post comments.