Aug 16, 2010, 10:36 PM
ViewState not working during OnRefreshData event
Hello,
I'm trying to persist some data in the ViewState during the OnRefreshData event from the Store object.
I've changed the ViewStateMode property of the store to Enabled and the EnabledViewState to true.
Can somebody help to understand what is wrong?
Here is the code
Ariel
I'm trying to persist some data in the ViewState during the OnRefreshData event from the Store object.
I've changed the ViewStateMode property of the store to Enabled and the EnabledViewState to true.
Can somebody help to understand what is wrong?
Here is the code
protected void stItems_RefreshData(object source, EventArgs e)
{
if (X.IsAjaxRequest)
{
if (ViewState[kVS_Statistics] == null)
ViewState[kVS_Statistics] = GetKPI().Values;
stItems.DataSource = (SortedDictionary<string, MonthLoad>.ValueCollection)ViewState[kVS_Statistics];
stItems.DataBind();
}
}
<ext:Store ID="stItems" runat="server" GroupField="Employee" AutoLoad="true" OnRefreshData="stItems_RefreshData" ViewStateMode="Enabled" EnableViewState="true">
<Proxy>
<ext:PageProxy />
</Proxy>
<SortInfo Direction="DESC" Field="Period" />
<Reader>
<ext:JsonReader IDProperty="ID">
<Fields>
<ext:RecordField Name="Employee" />
<ext:RecordField Name="Period" />
<ext:RecordField Name="EstimatedHours" Type="Float" />
<ext:RecordField Name="WorkedHours" Type="Float" />
<ext:RecordField Name="Performance" Type="Float" />
<ext:RecordField Name="BugsPreRelease" Type="Int" />
<ext:RecordField Name="BugsPostRelease" Type="Int" />
<ext:RecordField Name="SupportHours" Type="Float" />
<ext:RecordField Name="ProjectLoadSummary" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
Thanks,Ariel