New DataView mode for ListView (Coming soon in v14.1)

XAF Team Blog
22 May 2014

The UseServerMode Boolean property of the Options and ListView nodes is now replaced by the DataAccessMode property of the CollectionSourceDataAccessMode enumeration type. This enumeration contains the Client, Server and DataView values.

The Client value is equivalent to the UseServerMode set to false in previous versions. The Server value is equivalent to the UseServerMode set to true in previous versions.

DataView is a new mode. ListView in DataView mode retrieves XPView or EFDataView lightweight read-only lists of data records without loading complete persistent objects via XPCollection/EFCollection.

Check out the screenshot from the Model Editor for more details:

ListViewPerformance

As you might remember, this new Data View data source was first introduced in the ReportsV2 module, which provides the ViewDataSource component. Originally it was supported for XPO and then for Entity Framework (learn more...).


This functionality will be out as Beta in 14.1, because not all standard scenarios we planned for are covered and tested at this time. For instance, in the first version the DataView mode will work for Grid List Editors only. The rest of the built-in ListEditors (like TreeList , PivotGrid, Chart, Scheduler, etc.) will use Client mode by default, even if the DataView mode is specified in the model settings. Support for these List Editors is planned for the future. 

Also, data for non-persistent and reference properties will not be shown in ListView operating in DataView mode by default. To make reference properties work in WinForms, it is required to add a custom model column pointing to a nested property, e.g., Department.Title (this step is not required on the Web).

To enable this functionality on the Web, you currently need to modify the Global.asax.cs file as shown below:


protected void Application_Start(Object sender, EventArgs e) {
    ASPxGridListEditor.OldColumnsCreationMode = false;
}


We look forward to hearing your feedback on this new mode since Grid List Editors are used in more than 80% of list screens of a typical LOB application.

Yes, the ConditionalAppearance functionality is supported when this new mode is enabled in ListViews:-)

27 comment(s)
Nate Laff
Nate Laff

Thanks for (seemingly) automatically updating all of my UseServerMode views appropriately to the new schema :)

Excited to try this on Scheduler/Dashboard charts when eventually supported. Will hopefully be a huge help for me.

22 May, 2014
ytq 2080
ytq 2080

Very good!!!

22 May, 2014
Adam Stiskala
Adam Stiskala

Fantastic! We often run into issues loading large data sets (300,000+ rows) into list views. Can't wait to have a play with this feature.

22 May, 2014
Stepan Lauryn
Stepan Lauryn

It looks great. What do you expect speed increase compared to ServerMode on large tables in ListView? What in PivotGrid in large OLAP tables?

22 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Nate: Welcome! The Application Model supports versioning. So, it is a matter of a few code lines to update values of old model attributes to the new ones. If you are interested in using this mechanism for your own model options, check out documentation.devexpress.com

Yes, using this new mode for analytics would be good.

23 May, 2014
Alexander Krakhotko (Xafari team)
Alexander Krakhotko (Xafari team)

great news!

how to disable the calculation of the number and count pages?

on 30+ million row  with the active filter, function COUNT () works very slowly. Although "SELECT TOP 1000" - works very well.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Adam: Did you use server mode for such large lists previously? I am asking because performance issues are unexpected in this mode. I would be more than happy to learn more on this and probably have a small sample from you in the Support Center. Thanks.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@ytq 2080: Welcome!

@Stepan: It all depends on the case, e.g. the complexity of your persistent objects. BTW, take special note that in server mode records are queried by portions of a predefined size, while in the DataView mode all records are fetched, but just with a fixed set of data properties.

PivotGridListEditors do not currently support this mode as mentioned in the blog. I suggest you use standard XtraPivotGrid solutions for OLAP data binding.

23 May, 2014
Adam Stiskala
Adam Stiskala

@Dennis: Yes, we are using server mode in most places for these large list views (it comes down to how dynamic the customer wants the view - some lists are re-sorted and re-grouped a lot and server mode actually slows this experience down). The issues are generally around:

1. Performance when exported in server mode is degraded

2. Loading large amounts of data into grid views (and exporting this data) chews up a lot of memory and users can run out of memory easily.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Alexander: As far as I understand, you are talking about server mode, correct? From our experience, disabling the count will not greatly increase performance in a general case when an end-user can filter/sort/group by arbitrary grid columns, except for certain scenarios when you have optimized your database table and created indices for columns manipulated in the grid control. In any event, we would be more than happy to discuss your scenario further in the Support Center, if you provide us with a small sample and describe concrete scenarios where this works better (researching and discussing performance is usually ineffective without concrete samples). Thanks for your time in advance.

23 May, 2014
Adam Stiskala
Adam Stiskala

@Dennis: I've experienced the same issue as Alexander. This is because we use MySQL and in order to do a full count without a where cause, a table scan is required (see www.mysqlperformanceblog.com/.../count-for-innodb-tables). We've worked around this by not pre-loading data in list views for very large tables and instead waiting until a user enters filter/search data before showing results.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Adam, thanks for your answer. Some questions below:

>>

some lists are re-sorted and re-grouped a lot and server mode actually slows this experience down).

...

Performance when exported in server mode is degraded

<<

Is it possible for you to provide us with a sample and repro steps so we can measure the actual performance in your particular scenario and see what we can do for this? I am requesting this additional info because it is difficult with performance problems without profiling and debugging sample projects.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

Thanks for your additional feedback, Adam. Since it all depends on the case, we would be more than happy to research your business scenario with the help of a debuggable sample, database backup and repro steps. Your current solution with not-pre-loading data looks feasible, but maybe there are much better options to handle this, even if it does not mean using server mode at all.

23 May, 2014
Gustavo Marzioni
Gustavo Marzioni

I think that a really useful dataview mode for very large views (millions of records) should fetch data in portions like server mode.

23 May, 2014
Gustavo Marzioni
Gustavo Marzioni

A simple test (14.1 beta, 2 million recs BO), time to show a listview :

Server Mode: 0.25 secs (of course it is only loading a few records)

DataView Mode: 11 secs (reads the 2 millions rec)

Client Mode: 58 secs (and some out of memory errors)

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

Thanks for your comments, Gustavo. I see what you mean and it would be a nice feature. Actually, this DataView + Server Mode is in essence Async Server Mode aka Instant Feedback, which we are also considering supporting in XAF, at least for grids. In fact, we already started playing with this mode in the past (there is even a hidden IsAsyncServerMode property, which you can set in the constructor of your WinAppliction class), but this feature is not yet ready for public use. Hopefully, it will now be easier to finalize it due to the DataView support in ListView.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

BTW, feel free to share your results for the IsAsyncServerMode option here.

23 May, 2014
Tony Tadros
Tony Tadros

Hello Dennis

Will the list view be read only I tried setting to data view but still editable

Regards

Tony

23 May, 2014
Gustavo Marzioni
Gustavo Marzioni

@Dennis, BTW, my simple test with IsAsyncServerMode in 14.1 with conditional appearance looks awesome!

perhaps it will be nice if it can be enable per-listview.

23 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Tony: A ListView operating in DataView mode cannot be editable. Invoke a separate detail form to edit a selected record.

26 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Gustavo: Thanks for you for testing this and providing additional feedback on the IsAsyncServerMode option.

26 May, 2014
Martin Praxmarer - DevExpress MVP
Martin Praxmarer - DevExpress MVP

So was there any Progress on AsyncMode? @Gustavo -> a listview without key column was not supported -does this work now?

26 May, 2014
Dennis (DevExpress)
Dennis (DevExpress)

@Noxe: We did not work on improving the async mode in this release, but as I said above, supporting the new DataView mode may change the current situation, especially if there is a good demand for this from other customers.

26 May, 2014
mark.chen
mark.chen

when will the listview in winform support pager?

18 June, 2014
Roman Shelomanov
Roman Shelomanov

I think this Mode must be default for Web list view's.

24 June, 2014
Konstantin B (DevExpress)
Konstantin B (DevExpress)

Both Server and Data View modes are intended to improve List View performance, but in different areas.

If the database requests count is critical, then you should choose Data View mode. In this mode, all data records are fetched by a single request, and then grouping, sorting and filtering are executed on the client side without additional requests. Data View mode is appropriate when the current persistent type contains many references to other persistent types which also include lots of references. In the Data View mode, only data required by visible columns is loaded, while other modes (both Client and Server) will trigger multiple requests to load the entire date hierarchy.

If List View startup time is critical, then you should choose Server mode. In this mode, only a few visible objects are fetched by the first request when a List View is opened. However, scrolling, grouping, sorting and filtering leads to additional database requests - required data is loaded on demand.

If the performance is acceptable, simply use the Client mode. Do not enable Server and Data View modes unless you observe a lack of performance.

26 June, 2014
mark.chen
mark.chen

strongly suggest the GridListEditor of winform support page funtion

27 June, 2014

Please login or register to post comments.