Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
739
RowInitialize fires twice in 2009.2 if footer text set after data source set?
posted

I am in the process of upgrading a project from 2008.3 to 2009.2 and I noticed that a page was breaking due to InitializeRow firing twice for every row.  The cause turned out to be that I was setting footer text after setting the data source, so I switched the order and it solved my problem.

Has anyone else seen this, and do you know if it's a bug or by design?  It's definitely a change from how 8.3 worked.

Example snippets:

           //version 1 - if this is in page_load, all rows get initialized twice.

            grid1.DataSource = data;

            grid1.Columns["Annual_Budget"].Footer.Text = String.Format("{0:C}", Convert.ToDecimal(data.Compute("Sum([Annual_Budget])", "")));

 

           //version 2 - if this is in page_load, all rows get initialized once.

           if (data.Rows.Count > 0)

           {

                 grid1.Columns["Annual_Budget"].Footer.Text = String.Format("{0:C}",               Convert.ToDecimal(data.Compute("Sum([Annual_Budget])", "")));

           }

            grid1.DataSource = data;

 

Parents
  • 14049
    Offline posted

    Hello,

    It sounds like the grid gets data bound the first time when the Columns property is accessed. And then setting the footer text somehow invalidates the data and the grid data binds again on prerender.

    I'd suggestyou to bring this to the dev support's attention. Thanks.

Reply Children
No Data