Binding a Report Table outside of DataBind()...

3 posts, 0 answers
  1. Allen Smothers
    Allen Smothers avatar
    40 posts
    Member since:
    Nov 2006

    Posted 22 Apr 2011 Link to this post


    I'm using VS 2008 Q1 2010 Telerik Reporting

    I'm attempting to set and bind a Telerik.Reporting.Processing.Table inside of the Detail's detail_ItemDataBound event and I'm running into some trouble.

    I currently have a simple table inside my Report's detail. The table has a header and a detail row that repeats.

    Originally I was binding the table to a DataTable inside of the DataBind() and having no issues.  After having some trouble getting the table's groupings correct I decided it would be a little more practical move the Telerik.Reporting.Processing.Table binding inside the detail_ItemDataBound event and bind it there with the correct data.  When I move the binding inside the detail_ItemDataBound event I get a blank table with no data.

    Below is my code from the detail_ItemDataBound event:
    private void detail_ItemDataBound(object sender, EventArgs e)
        Telerik.Reporting.Processing.DetailSection detail = (Telerik.Reporting.Processing.DetailSection)sender;
        Telerik.Reporting.Processing.TextBox txtHierarchicalEntityID = (Telerik.Reporting.Processing.TextBox)detail.ChildElements.Find("txtHierarchicalEntityID", true)[0];
        Telerik.Reporting.Processing.Table tblReport = (Telerik.Reporting.Processing.Table)detail.ChildElements.Find("tblReport", true)[0];
        int hierarchicalEntityID = Convert.ToInt32(txtHierarchicalEntityID.Text);
        dsReporting dsBindingData = new dsReporting();
        foreach (dsReporting.AssessmentResultsChartRow currRow in dsRaw.AssessmentResultsChart.Rows)
            if ((int)currRow["HierarchicalEntityID"] == hierarchicalEntityID)
        tblReport.DataSource = dsBindingData.AssessmentResultsChart;

    Am I missing anything simple that would keep the tblReport from binding correctly?

    Thanks for the help and let me know if you need anything else,
  2. Peter
    Peter avatar
    1631 posts

    Posted 27 Apr 2011 Link to this post

    Hi Allen Smothers,

    The ItemDataBound event is called too late for binding data items. ItemDataBound fires just after the section is bound to data while the ItemDataBinding fires just before the section is bound to data. We will appreciate if you elaborate your scenario in detail in order to help you find the most suitable solution.

    You may find useful the following help articles:

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Allen Smothers
    Allen Smothers avatar
    40 posts
    Member since:
    Nov 2006

    Posted 28 Apr 2011 Link to this post

    Thanks Peter,

    I've found a solution using SubReports.

    Thanks again,
Back to Top