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
I have found out that the Skin or the css causes this. Removing only the SkinID fixes the exception.
The Skin and CSS looks like this and I can not see why there is an error in one page but not in the other:
SKIN:
<%@ Register assembly="Infragistics4.Web.v10.3, Version=10.3.20103.2134, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.GridControls" tagprefix="igwdg" %>
<igwdg:WebDataGrid SkinID="WebDataGrid" AutoGenerateColumns="false"
HeaderCaptionCssClass="wdg_HeaderCaption" AltItemCssClass="wdg_AltItem" ItemCssClass="wdg_Item"
runat="server">
<Behaviors>
<igwdg:ColumnResizing Enabled="true" />
<igwdg:Paging PagerAppearance="Bottom" PageSize="10" Enabled="true" />
<igwdg:Sorting SortingMode="Single" Enabled="true">
</igwdg:Sorting>
<igwdg:ColumnMoving DragStyle="Slide">
<ColumnSettings>
<igwdg:ColumnMoveSetting EnableMove="true" />
</ColumnSettings>
</igwdg:ColumnMoving>
</Behaviors>
</igwdg:WebDataGrid>
CSS:
/*Header-Caption*/
.wdg_HeaderCaption
{
text-align: left;
font-size:0.9em;
color:#000;
}
/*Header*/
.igg_Header
background-image:none;
background-color:#DBDBDB;
cursor:pointer;
/*every row*/
tbody.igg_Item>tr>td
background-color:#fff;
/*every second row*/
tbody>tr.igg_Alt>td
background-color:#F2F2F2;
Hello BlueScreenISU,
The SkinID is related to ASP.NET Themes which is consistent layout for server side controls however our controls defines our style out of the box using css only.
Is the error that you're still referring to is "Infragistics.Web.UI.GridControls.Behaviors ViewState is corrupted."? In the case of loading controls dynamically on the page would not track any ViewState so the controls would have to be recreated at every postback.
For knowing any cause of an error I would have to run a sample for reproducing on my local machine.
Let me know if you have any questions with this matter. Thank you.