How to get runtime property in ClickEvent?
I write code like this:
If use (PrintObject.OriginalComponent as TestTextObject).TestProperty, it get the value of last datarow
    public class TestTextObject : TextObject
    {
        private String _TestProperty;
        public String TestProperty
        {
            get { return _TestProperty; }
            set { _TestProperty = value; }
        }
    }
And register it:
    FastReport.Utils.RegisteredObjects.Add(typeof(TestTextObject ), "ReportPage", new Bitmap(16,16), "TestTextObject", 0, false);
In a FastReport, I add a instance of TestTextObject and set ClickEvent, BeforePrintEvent, AfterPrintEvent
    DataBand _DataBand = FReport.FindObject("Data1") as DataBand;
    TestTextObject text3 = new TestTextObject ();
    text3.Bounds = new RectangleF(10, 10,
    Units.Centimeters * 10, Units.Centimeters * 0.5f);
    text3.Text = "ä¸æ–‡å—ddddddddd";
    text3.BeforePrintEvent = "text3_BeforePrint";
    text3.AfterPrintEvent = "text3_AfterPrint";
    text3.ClickEvent = "text3_Click";
    _DataBand.Objects.Add(text3);
The script like this:
    private void text3_BeforePrint(object sender, EventArgs e)
    {
      TestTextObject _PrintObject = sender as TestTextObject;
                  String[] _Expressions = (_PrintObject.OriginalComponent as FastReport.TextObject).GetExpressions();
                  foreach (String _Expression in _Expressions)
                  {
                      String[] _ElementList = _Expression.Split('.');
                      //it isn't from DataSource
              if (_ElementList.Length <= 1)
                          continue;
                      //TableName
              String TableName = _ElementList[_ElementList.Length - 2];
                      FastReport.Data.TableDataSource _DataSourceBase = _PrintObject.Report.Dictionary.FindByAlias(TableName) as FastReport.Data.TableDataSource;
                      if (_DataSourceBase == null)
                          _DataSourceBase = _PrintObject.Report.Dictionary.FindByName(TableName) as FastReport.Data.TableDataSource;
                      if (_DataSourceBase == null)
                            continue;
                      //Set the first value of DataRow Â
                      _PrintObject.TestProperty = (_DataSourceBase.CurrentRow as System.Data.DataRow)[0].ToString();
                    }
    }
    private void text3_AfterPrint(object sender, EventArgs e)
    {
                    //the code is same to text3_BeforePrint
    }
    private void text3_Click(object sender, EventArgs e)
    {
      TestTextObject _PrintObject = sender as TestTextObject; Â
      MessageBox.Show(_PrintObject.TestProperty.ToString());
    }
I expect the result of Message is: the first column's value of each datarow, But it is null! Why?! How can i do?If use (PrintObject.OriginalComponent as TestTextObject).TestProperty, it get the value of last datarow
Comments
It's not so simple to create own report object. At least, you have to override the following methods of the new object: