ActiveReports 18 .NET Edition
MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports.SectionReportModel Namespace / CustomControl Class / Control Property
Example

In This Topic
    Control Property (CustomControl)
    In This Topic
    Gets or sets a reference to the hosted control.
    Syntax
    'Declaration
     
    Public ReadOnly Property Control As Object
    public object Control {get;}
    Example
    private void Detail1_Format(object sender,System.EventArgs e)
    {
     DataTable dt = new DataTable();
     dt.Columns.Add("Name", typeof(string));
     dt.Columns.Add("Age", typeof(int));
     dt.Rows.Add("Name1", 23);
     dt.Rows.Add("Name2", 34);
     System.Windows.Forms.DataGridView gridView = ((System.Windows.Forms.DataGridView)this.customControl1.Control);
     gridView.DataSource = dt;
    }
    Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
    Dim dt As New DataTable()
    dt.Columns.Add("Name", GetType(String))
    dt.Columns.Add("Age", GetType(Integer))
    dt.Rows.Add("Name1", 23)
    dt.Rows.Add("Name2", 34)
    Dim gridView As System.Windows.Forms.DataGridView = DirectCast(Me.customControl1.Control, System.Windows.Forms.DataGridView)
    gridView.DataSource = dt
    End Sub
    See Also

    Reference

    CustomControl Class
    CustomControl Members

    How To

    Use Custom Controls on Reports (TreeView)