ActiveReports 18 .NET Edition
MESCIUS.ActiveReports.Aspnetcore.Designer Assembly / GrapeCity.ActiveReports.Aspnetcore.Designer Namespace / DesignerSettings Class / SetLocateDataSource Method
Example

In This Topic
    SetLocateDataSource Method (DesignerSettings)
    In This Topic
    Sets data source locator
    Syntax
    'Declaration
     
    Public Sub SetLocateDataSource( _
       ByVal locateDataSource As Func(Of Object) _
    ) 
    public void SetLocateDataSource( 
       Func<object> locateDataSource
    )

    Parameters

    locateDataSource
    Example
    public class TestObject
    {
        public string StringProperty { get; set; }
        public int IntProperty { get; set; }
    }
    
    public class TestObjectsStorage
    {
        public TestObject[] Data { get; }
    
        public TestObjectsStorage()
        {
            Data = new TestObject[10];
    
            for (var i = 0; i < Data.Length; ++i)
            {
                ar testObject = new TestObject
                {
                    StringProperty = "Field N" + i,
                    IntProperty = i
                };
    
                Data[i] = testObject;
            }
        }
    }
    
    app.UseDesigner(config =>
    {
    	config.SetLocateDataSource(() => new TestObjectsStorage());
    });
    See Also