Why I cant change object property at runtime

I'm using a treeview control on VS.As the code below.textobject "villageName"s text havnt changed.
protected void RegionsTree_SelectedNodeChanged(object sender, EventArgs e)
        { 
                FDisclosureReport.ReportDataSources = "VoucherDataSource;BalanceDataSource";
                FastReport.TextObject villageName = FDisclosureReport.Report.FindObject("villageName") as FastReport.TextObject;
                villageName.Text = RegionsTree.SelectedNode.Text;
                FDisclosureReport.DataBind();
                FDisclosureReport.Refresh();
        }

Comments

  • edited 9:54PM
    Hello,

    The code is correct. Probably the report is not refreshed propertly when you call the FDisclosureReport.Refresh(). Probably you load the report file in this method? In this case, the villageName is loaded from a file and loses your settings.
  • edited 9:54PM
    I havnt load the report file twice.Just set the "reportFile" property to "report.frx" at designtime. Is somewhere wrong?
  • edited 9:54PM
    Do you use WebReport component? If so, you have to change the report in the WebReport.StartReport event.
  • edited 9:54PM

    It works.But that mean I cant control it in another event like selectedNodeChanged in Treeview. and DataBind() refresh()[makes endless loop] cant stay in it.it's somewhat inconvenient.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.