Quantcast
Channel: XAF Team Blog
Viewing all articles
Browse latest Browse all 148

XAF: Enhancements to Existing Features & Performance Tuning (Coming soon in v14.2)

$
0
0

Grid Designer for List View

In XAF v14.2, responding to customer feedback, we introduce a new easy-to-use way to configure List View columns at design time. Model Editor now includes a designer that imitates the grid filled with sample data. When the ListView | Columns node is focused, the property list to the right is replaced with a design surface. This allows you to see how the grid will be displayed at runtime. Take special note that while the WinForms Data Grid control is displayed at design time. However, the customizations are correctly applied for both WinForms and ASP.NET applications.



The designer provides the same configuration capabilities that are available in XAF WinForms applications at runtime. You can:

  • resize columns;
  • drag and drop column headers to re-arrange columns;
  • hide a column by dragging it outside the grid;
  • show hidden columns using Column Chooser;
  • apply sortinggrouping and filtering;
  • display summaries (when you enable the IsFooterVisible property).


Data-Specific Column Types for ASPxGridView

Starting from version 14.2, opening, paging, grouping, sorting and filtering of lists displayed through the ASPxGridView control in XAF works noticeably faster. We extended our code to use data-specific column types whenever possible. The use of data-specific columns for simple types like System.String, System.DateTime, System.Boolean, etc. allows reducing the request processing time on the server side, reducing rendering time in the browser and reducing traffic due to the simplified page structure. 

Take a look at the video that demonstrates an XAF Web application displaying a grid with 50 objects and 13 columns within Internet Explorer 11 on the test machine with Intel(R) Core(TM) i7-3770 CPU 3.40GHz, 16384MB RAM, Windows 8 Enterprise 64-bit and IIS 7 

ASPxGridView

These are the results of our measurements of this application:

chart

By default, table data in ListView of XAF Web applications is displayed using the ASPxGridView control. Previously, cell values were displayed using the ITemplate templates specified via the GridViewDataColumn.DataItemTemplate property for data cells and GridViewDataColumn.EditItemTemplate for edit cells. With this approach, we have full control of the data representation in grid cells and can use the same editors to display properties in List Views and Detail Views. However, the approach has certain drawbacks, like overall complexity, increased markup generation and rendering time, and difficulties in configuration and customization.
 

To overcome these drawbacks, in version 14.2, we extended our code to use data-specific column types whenever possible. Even though the DataItemTemplate approach is still used when there is no appropriate data-specific column information, the performance impact is significant in many configurations. In the inline edit mode, we still the rich editing capabilities of EditItemTemplate (which are also used in the Detail Views).

You can easily adjust the default columns settings or create  new custom columns using events the following ASPxGridListEditor class events: CustomizeGridViewDataColumnCreateCustomDataItemTemplateCreateCustomEditItemTemplateCreateCustomGridViewDataColumn.

Please note the following limitations of the new mode.

  • You cannot navigate to a referenced object by clicking a cell that displays a reference property.
  • The "N/A" text is not displayed for null reference values.

If you want to revert back to the old mode for any reason, set the static ASPxGridListEditor.UseASPxGridViewDataSpecificColumns property to false in the Global.asax.cs (Global.asax.vb) file:

 
protectedvoid Application_Start(Object sender, EventArgs e) {
ASPxGridListEditor.UseASPxGridViewDataSpecificColumns = false;
// ...
}


New Image Property Editor


As a part of the effort to speed up XAF applications, we will introduced support of byte array image storage for Image Property Editors (in both WinForms and ASP.NET). This allows us to decrease web server memory consumption, because the byte array can contain an image in a compressed format and the server does not have to unpack it. Additionally, you can enable the delayed (or lazy) loading of images to further decrease memory usage. Practically, this means that you can display large list views with lots of images and experience no performance issues. 



Another nice thing about the new editor is that we made it possible to navigate to a detail form when clicking on the image cell in the ListView, which was not present previously.

To use a byte array persistent property as an image storage, simply decorate it with the ImageEditor attribute:

[ImageEditor]
public Byte[] Photo { get; set; }

If you want to implement lazy loading for such properties, check out the examples for Entity Framework and XPO when v14.2 is out.

Notice that the previous approach with the System.Drawing.Image type property is still supported, but we recommend that you migrate to the byte array storage to get the performance benefits described above.


Solution Wizard Improvements


Now you can run the Solution Wizard from an existing solution to add extra XAF projects (Application Server,Workflow Server, etc.):


Additionally the wizard is now included in the DevExpress Template Gallery. Our future plans regarding the wizard include better organization of the XAF Item Templates (ViewController, Frame Templates, etc.) and capability to create test data and configuration for all the XAF extra modules.

Data View Mode for List View

The Data View mode released as a beta in v14.1 is now fully released in 14.2. In this mode, a lightweight read-only list of data records (a data view) is retrieved from a database in a single request without loading complete business objects. This list can be queried much more quickly than a real objects collection. You can now use this feature in your production environment to improve performance for use-case scenarios involving large volumes of data.



Miscellaneous Improvements

·       Specifying a client's logo is now completely simple. You can set the required image using the Logo property of the Application node in the Model Editor. This works both for WinForms and ASP.NET applications, and you no longer need to dig into the details of different approaches for WinForms and ASP.NET in most cases - the framework handles this all for you.

·       Newly created XAF Web apps will now display detail collections in DetailView, which is in 'edit' mode by default (don't worry as this does not affect existing apps). This saves your extra clicks on switching between the"view" and 'edit' modes.

·       The ExpandObjectMembers attribute now allows expanding a specified single member of a complex type property. This adds more control over layout generation in both ListView and DetailView as previously you could only expand all or nothing.


·       An Entity Framework-based version of our popular XCRM demo was created in this release. While accomplishing this task, we strengthened Entity Framework support in XAF and improved its stability. Check it out at %Public%\Documents\DevExpress Demos 14.2\Components\eXpressApp Framework\XCRM\CS\ once you get your hands at 14.2!

·       DevExpress XPO (an alternative to Microsoft Entity Framework for data access in XAF) now supports the latest ADO.NET connector libraries for Sybase (Sybase.AdoNet2.AseClient.dll and Sybase.AdoNet4.AseClient.dll), which are completely managed and include the latest improvements for working with this database engine.


As always, we welcome your comments and feedback. Let us know what you think.

Viewing all articles
Browse latest Browse all 148

Trending Articles