I am using a gridview within an update panel to display weekly data, the user needs to be able to change the number of weeks displayed and edit the data for the weeks displayed. I am changing the number of weeks shown by clearing the grid and repopulating it as I had problems using the remove/removeAt methods. Originally I was using Version 9, but have updated to version 12 with no improvement.
My issue is that the program falls over if the user reduces the number of weeks displayed and some of the data for a week that is being removed from display has changed in the session. If data has changed only in columns that aren't being removed or we are adding columns it works fine.
The error is sometimes thrown in file "eval code [dynamic]" and reads
"Unhandled exception at line 6, column 22610 in http://localhost:52668/eo_web.ashx?id=ae96c5cb-01d3-41cf-a61d-8c4f20521430
0x800a138f - JavaScript runtime error: Unable to get property 'aam' of undefined or null reference"
Othertimes it is a webpage error:
"Line: 6
Error: Unable to get property 'aam' of undefined or null reference"
and the debugger takes me to eo_web.ashx
Code: C#
for (int i = 5; i < numberOfWeeks + 5; i++)
{
// add another column to the table for this weeks data
grdEmployeeProductivity.Columns.Add(new EO.Web.TextBoxColumn() { TextBoxMaxLength = 3, CellStyle = new EO.Web.ElementStyle()
// fill the column
grdEmployeeProductivity.Columns[i].DataField = dt.Columns[i + 3].ColumnName.ToString();
grdEmployeeProductivity.Columns[i].HeaderText = dt.Columns[i + 3].ColumnName.ToString();
grdEmployeeProductivity.Columns[i].ClientSideBeginEdit = "on_begin_editProductivity";
}
this.grdEmployeeProductivity.DataSource = dt.DefaultView;
this.grdEmployeeProductivity.DataBind();
UpdatePanelEmployeeProductivity.Update();