.NET Framework 4.6.1
We upgraded our solutions from Infragistics45.Web.v14.1, Version=14.1.20141.2150 to Infragistics45.Web.v15.2, Version=15.2.20152.2042. It introduced an error on our WHDG with a SummaryRow. The grid is on a WebTab. The grid and behaviors are being created on the server in the Grid_Init event. This event executes when the page loads and again on each tab change. The grid columns, behaviors and bands are cleared in the Grid_Init, then built again. The problem with the 15.2 release is the SummaryRow is being built twice.
The order of execution has changed between 14.1 and 15.2. In 14.1 the Grid_Init always executes prior to Page_Init. In 15.2 the Grid_Init executes prior to Page_Init when the page first loads. But on the tab change event, the Page_Init executes first. I do not know if this is connected to the change in behavior but just something I noticed. Any ideas on why this changed? Thanks.
Hello,
Thank you for contacting us and for the provided information.
About your question, there were a lot of changes between 14.1 and 15.2, like issue fixes, Grid performance improvements etc, so I could not tell you exactly what is causing this change. As a suggestion, you could check if the summary row is build and to skip the second build.
Also I can assure you that the event execution wont change soon, as I see the sequence is Grid_Init -> Page_Init -> Page_Load
Thank you for the response. Take your example and add the following to the WebTab.
AutoPostBackFlags-SelectedIndexChanged="On"
You will see when you change tabs the sequence is different. This changed between IG releases.
Page_Init -> Grid_Init
I did get beyond the summary row error by only building the summary row when not isPostBack. But I have encountered another error that I cannot get resolved. It does not appear to be the change in sequence. We have a WebTab that contains 5 tabs with user controls. On the first tab there is an icon that calls a popup. When the popup data is saved, the popup closes and the page behind is refreshed. Then we get a viewstate error. No other changes have been made to our code except the Infragistics upgrade. This worked correctly in 14.1. We have included InstantiateTemplates on all the WebTabs which fixed many of our errors with the upgrade but not this one. Any ideas?
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.
Stack Trace
StackTrace Information--------------------------------------------- at System.Web.UI.Control.LoadViewStateRecursive(Object savedState) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.get_TemplateContainerControl() at Infragistics.Web.UI.GridControls.WebDataGrid.InstantiateTemplates() at Infragistics.Web.UI.GridControls.ContainerGrid.EnsureTemplates() at Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.OnPreRender(EventArgs e) at Infragistics.Web.UI.GridControls.WebDataGrid.OnPreRender(EventArgs e) at Infragistics.Web.UI.GridControls.ContainerGrid.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Our grids are defined in the HTML and the columns are added on the server side. As a test, I just moved all the columns from the server to the HTML. I get the same error. The error will not occur if the tab with the WHDG is the first tab or you go this this tab first. Then all processing proceeds as expected. That is why I think it has to do with the change in the order of events firing.
If I add EnableViewState ="false" to the WHDG, the error will not appear but the grid functionally does not work.
Okay, then I will need to check more deeply why this is happening, is it possible for you to isolate the exception in the sample from my previous reply, since I am unable to, this will be highly appreciated? Maybe I am missing something else, like when you databind the Grid..
Looking forward to hearing from you.
I can avoid the ViewState error by setting the property in the HTML on the WHDG Visible="false". Then when the tab is selected set the property to display the grid in the code.
Our solution is complex and contains hundreds of Infragistics controls. Every time we take an Infragistics release update, we spend way too much time trying to fix things that the IG release introduced. This problem alone took me over 20 hours to come up with a work around. Plus I cannot explain the problem.
I understand that you put a lot efforts already and I wanted to let you know that I have tried a couple of things in order to reproduce the issue on my side. I have set up WHDG with server side data binding and with SqlDataSource, because by my opinion this is causing the error, the way the grid binds to its data, and this is why the ViewState error is thrown. Could you please let me know when exactly you databind the Grid, I have asked you already in my previous reply?
The WHDG grid data is bound when the WebTab tab is selected. In our case, it is the second tab. If I move the WHDG to the first tab there is no ViewState error.
Yes I've noticed the new case and also I have logged this into our internal system, case number "CAS-171821-Y1S4S3" and Work Item #217518.
We could continue our communication through the case only.
Thanks. I tried to update this forum entry yesterday to let you know that I opened a case with my project. The IG site was not responding.
I have logged this behavior in our internal tracking system with a Development ID of 217518. I have associated it with case number CAS-171821-Y1S4S3 , so that you can be notified when the bug is fixed. You can find your active cases under Account - Support Activity in our website. Select your ticket and go to Development Issues tab to view the status of related bugs.
Let me know if I may be of further assistance.
It is not that easy to share a sample because our pages are so complicated but I will try. We have this problem now on 4 different pages. They are all different but have a couple things (that I can see so far) in common, they all have an editable WHDG, a WebTab and broke when we did the IG upgrade.
Could you please share your sample with me then.