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)
{
}
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.
Hi
I am facing the similar issue, I don't have any footer but Initialize row event fires twice. I am using Netadvantage fro ASP.NET 12.2. Could you please help in making single Initialize Row call.
Regards,
Ahmed