Skip to main content
All docs
V23.2

BindToTypePolicy.QueryBindToTypeEventArgs.Type Property

Gets or sets the type.

Namespace: DevExpress.Utils

Assembly: DevExpress.Data.v23.2.dll

NuGet Package: DevExpress.Data

Declaration

public Type Type { get; set; }

Property Value

Type Description
Type

The type.

Remarks

Use the Type property to resolve the type.

namespace DXApplication {
    internal static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DevExpress.Utils.BindToTypePolicy.QueryBindToType += BindToTypePolicy_QueryBindToType;
            Application.Run(new Form1());
        }
        private static void BindToTypePolicy_QueryBindToType(object sender, DevExpress.Utils.BindToTypePolicy.QueryBindToTypeEventArgs e) {
            if (!e.IsKnownType) {
                // Resolves custom datasource types for DevExpress Reports.
                if (e.TypeName == "ProductsJsonDataSource")
                    e.Type = typeof(ProductsJsonDataSource);
                if (e.TypeName == "UsersJsonDataSource")
                    e.Type = typeof(UsersJsonDataSource);
            }
        }
    }
}
See Also