Hello,
I have 2 pages, both load their controls dynamically.
each page loads a few controls, one of these controls contains a WebDataGrid bound to test data, setting DataSource to a manually filled list.
Those 2 controls with WebDataGrid are not the same control, but they are actually technically equal.
At Page 1 everyhting works fine.
At Page 2 any time a postback occurs I get the following exception:
Infragistics.Web.UI.GridControls.Behaviors ViewState is corrupted.
bei Infragistics.Web.UI.Framework.ObjectCollection.LoadViewStateItems(ArrayList itemList)
bei Infragistics.Web.UI.Framework.ObjectCollection.LoadViewState(Object savedState)
bei Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState)
bei Infragistics.Web.UI.GridControls.WebDataGrid.LoadViewState(Object savedState)
bei System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
bei System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
bei System.Web.UI.Control.AddedControl(Control control, Int32 index)
bei System.Web.UI.ControlCollection.Add(Control child)
bei Binner.ProjectManager.GraphicalUserInterface.Classes.ContentPage.LoadPageControls(BaseElement baseElement) in N:\ProjectManager\Binner.ProjectManager.GraphicalUserInterface\Classes\ContentPage.cs:Zeile 170.
bei Binner.ProjectManager.GraphicalUserInterface.Classes.ContentPage.OnLoad(EventArgs e) in N:\ProjectManager\Binner.ProjectManager.GraphicalUserInterface\Classes\ContentPage.cs:Zeile 47.
bei Binner.ProjectManager.GraphicalUserInterface.Pages.Workplace.Dependencies.OnLoad(EventArgs e) in N:\ProjectManager\Binner.ProjectManager.GraphicalUserInterface\Pages\Workplace\Dependencies.aspx.cs:Zeile 40.
bei System.Web.UI.Control.LoadRecursive()
bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
nothing special in the aspx:
Part of Page 1:
<tr>
<td colspan="3">
<igmisc:WebPanel ID="WebPanel1" runat="server" SkinID="ContentWebPanel" Header-Text="<%$ Resources:Lang, WorkplaceRecordsControl_recordRegistrationWebPanel %>"
Header-TextAlignment="Left">
<Header Text="WorkplaceRecordsControl_recordRegistrationWebPanel" TextAlignment="Left">
</Header>
<Template>
<ig:WebDataGrid ID="recordRegistrationDataGrid" runat="server" SkinID="WebDataGrid" AutoGenerateColumns="False">
<Columns>
<ig:BoundDataField DataFieldName="Date" Key="Date">
<Header Text="Date" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="Duration" Key="Duration">
<Header Text="Duration" />
<ig:BoundDataField DataFieldName="Description" Key="Description">
<Header Text="Description" />
</Columns>
</ig:WebDataGrid>
</Template>
</igmisc:WebPanel>
</td>
</tr>
Part of Page 2 (Erroring):
<ig:WebDataGrid ID="webDataGridProjectDependencies" runat="server"
SkinID="WebDataGrid" AutoGenerateColumns="False">
<ig:BoundDataField DataFieldName="Predecessor" Key="Predecessor">
<Header Text="Predecessor" />
<ig:BoundDataField DataFieldName="PSP" Key="PSP">
<Header Text="PSP" />
<ig:BoundDataField DataFieldName="RelationType" Key="RelationType">
<Header Text="RelationType" />
<ig:BoundDataField DataFieldName="Offset" Key="Offset">
<Header Text="Offset" />
The exception occurs right after I add another control into the control with Controls.AddAt(0, control) int he OnInit() override. (removing this does not help)
So I suspect while trying to load ViewState in LoadViewState() (not overridden) the exception is thrown.
(setting "EnableViewState" = "Disabled", of course, fixed this exception, but not my problem :-))
I am using Volume 2010.3.2134
Need help!
Thanks
Carsten
Hello BlueScreenISU,
This is just a follow up on the thread if you had any questions or need any further assistance with the WebDataGrid.
Let me know if you have any questions with this matter. Thank you.
Thanks for the update.
You can attach the sample in the thread or I can create a private case for this on reproducing the error. I'll follow up on the thread in the next two weeks.
hi,
if I got the time I will try to build a small example app, but I am pretty sure that I can not reproduce this error this way, but I will try.
It is hard to explain what controls are added.
I already explained the page structure in my initial post.
For now, I am in holydays for the next 2 weeks.
later
blue
It would be helpful to provide more information in regards to what controls specifically are being added dynamically. Also I would have to run a sample and reproduce on my machine to determine the cause of such behavior.
In the WebDataGrid has it's own Init server side event. You may be able to add controls dynamically upon postback in the Init event to determine any difference.
as I said before, disabling viewstate for this one control fixes the exception, but I can not use any sorting etc features then.
setting EnableViewStateMac to false did not change anything.
I finally "fixed" the issue by moving all the behaviors, css and attributes for the control from the skin directly to the control in die ascx, but still I can not see why that makes a difference and we need to investigate.
none the less, thanks for your help