Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to display details collections with descendant classes filtered by object type in a DetailView

$
0
0

Suppose we have the same classes structure as shown in the How to: Use UpCasting help topic.
Our goal is to provide two details collections into a DetailView that will allow end-users to view objects of the LocalEmployee and ForeignEmployee classes separately in a Department DetailView.
In order to do this, we will declare two calculated details collections in the Department class and also write some code to update these collections when objects are added in or deleted from the main (associated) Employees collections.
By design the Employees collection is intended to list both local and foreign employees and also to allow end-users to perform any operations with them. The LocalEmployees and ForeignEmployees collections are intended to view objects only. So, the corresponding nested ListViews will be readonly.

See Also:
How to: Set Relationships Between Objects
How to: Calculate a Property Value Based on Values from a Detail Collection
How to filter persistent objects against their type

Question Comments

Added By: Willem de Vries at: 9/12/2012 11:36:40 AM    

I'm curious why HintCollection is used despite the documentation stating:
HintCollection - This member supports the .NET Framework infrastructure and cannot be used directly from your code.

Added By: Dennis (DevExpress Support) at: 3/11/2013 2:08:29 AM    

The HintCollection property is used here to specify a data source for an XPCollection.

Added By: Randy Jean at: 12/5/2014 11:07:54 AM    

Is there any way for these descendant collections to not be read-only?  Or, at the very least, when the list view is clicked the detailview is not read-only?  

Also, on the top-level listview (not filtered) can the New button be set to always drop down the list of objects?  Users are complaining that they hit the "button" part of the New and they don't realize there are different objects to choose to add.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>