Hi,
I am having asp.net gridview with edit functionality.
also I am having column grouping on OnDataBound like:
GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableHeaderCell cell = new TableHeaderCell();
cell.Text = "Start";
cell.ColumnSpan = 1;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.ColumnSpan = 2;
cell.Text = "Conclusion";
row.Controls.Add(cell);
cell.BackColor = System.Drawing.ColorTranslator.FromHtml("#80CBC4");
cell = new TableHeaderCell();
cell.ColumnSpan = 1;
cell.Text = "Action";
row.Controls.Add(cell);
//row.BackColor = ColorTranslator.FromHtml("#3AC0F2");
gridResumeManagement.HeaderRow.Parent.Controls.AddAt(0, row);
When i click edit then i get the error
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Thanks.