BindToTypePolicy.QueryBindToTypeEventArgs.Type Property
In This Article
Gets or sets the type.
Namespace: DevExpress.Utils
Assembly: DevExpress.Data.v24.2.dll
NuGet Package: DevExpress.Data
#Declaration
#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