The requested page is not available for the requested platform. You are viewing the content for Default platform.

FavoritePropertyExtension.GetFavoriteProperties(Type) Method

Returns predefined favorite properties for the specified type.

Namespace: DevExpress.XtraReports.Extensions

Assembly: DevExpress.XtraReports.v19.1.dll


public static string[] GetFavoriteProperties(
    Type componentType
Public Shared Function GetFavoriteProperties(
    componentType As Type
) As String()


Name Type Description
componentType Type

An object that specifies the type for which favorite properties should be obtained.


Type Description

An array of strings that specify favorite property names.


Use the static FavoritePropertyExtension.GetFavoriteProperties method to get the predefined set of favorite properties for a specific report element type. You can then customize the obtained array as required (delete and/or add new properties) and assign it to the storage extension class using the FavoritePropertyDirectoryExtension.SaveProperties method.

The following example allows you to customize predefined favorites for a report, in particular, remove the FilterString property and add the CalculatedFields property.

using System;
using System.Windows;
using System.Collections.Generic;
using System.IO;
using DevExpress.XtraReports.Extensions;
using DevExpress.XtraReports.FavoriteProperties;
using DevExpress.XtraReports.UI;

// ...
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "FavoriteProperties.xml");
FavoritePropertyDirectoryExtension extension = new FavoritePropertyDirectoryExtension(path);
DescriptionSet set;
if (!extension.TryLoadProperties(out set)) {           
    List<string> favorites = new List<string>(FavoritePropertyExtension.GetFavoriteProperties(typeof(XtraReport)));
    set = new DescriptionSet();
    set.SetProperties(typeof(XtraReport).Name, favorites.ToArray());

See the following topics for more information:

See Also