or

Following piece of code giving me error, please see screen shot attached.UIHelpers.SetSessionVariable("_isNewDates", false);if (RadCalendar1.SelectedDates != UIHelpers.CovertFromArrayList((ArrayList)UIHelpers.GetSessionVariable("_oldDates", new ArrayList()))){UIHelpers.SetSessionVariable("_isNewDates", true);}UIHelpers.SetSessionVariable("_oldDates", UIHelpers.CovertToArrayList(RadCalendar1.SelectedDates));
Check this link for exact error as I took this screenshot
I just implement RadCalendar instead of my ASP.net Calendar and hope someone can help me.
<asp:ScriptManager id="ScriptManager" runat="server" EnableHistory="true" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true" /><asp:ScriptManagerProxy ID="wsScriptManagerProxy" runat="server" OnNavigate="ScriptManager_Navigate" />private static string pageKey = "p";protected void ScriptManager_Navigate(object sender, HistoryEventArgs e) { if (e.State.Count <= 0) { // Setup default state workspaceGrid.MasterTableView.CurrentPageIndex = 0; return; } string key = e.State.AllKeys[0]; string state = String.Empty; if (String.Equals(key, pageKey)) { state = e.State[key]; int pageIndex = int.Parse(state); workspaceGrid.MasterTableView.CurrentPageIndex = pageIndex; workspaceGrid.MasterTableView.Rebind(); } }protected void workspaceGrid_PageIndexChanged(object sender, GridPageChangedEventArgs e) { //string state = (sender as RadGrid).MasterTableView.CurrentPageIndex.ToString(); string state = e.NewPageIndex.ToString(); ScriptManager.GetCurrent(this.Page).AddHistoryPoint(pageKey, state); }public DataTable ProductsTable{ get { DataTable res = (DataTable)this.Session["ProductsTable"]; if (res == null) { res = DataSourceHelperCS.GetDataTable("SELECT [ProductID], [ProductName], [Discontinued] FROM [Products]"); this.Session["ProductsTable"] = res; } return res; }}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:radgrid ID="RadGrid1" runat="server" AllowMultiRowEdit="True" DataSourceID="SqlDataSource1" OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"> <MasterTableView DataKeyNames="ProductID" AutoGenerateColumns="false" EditMode="InPlace" CommandItemDisplay="TopAndBottom"> <Columns> <telerik:gridboundcolumn ReadOnly="true" DataField="ProductID" UniqueName="ProductID" HeaderText="ProductID"> </telerik:gridboundcolumn> <telerik:gridboundcolumn ReadOnly="true" DataField="ProductName" UniqueName="ProductName" HeaderText="ProductName"> </telerik:gridboundcolumn> <telerik:GridCheckBoxColumn DataField="Discontinued" DefaultInsertValue="" HeaderText="Discontinued" UniqueName="Discontinued" DataType="System.int16"> </telerik:GridCheckBoxColumn> <telerik:grideditcommandcolumn UniqueName="EditCommandColumn" /> </Columns> <CommandItemTemplate> <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" /></CommandItemTemplate> </MasterTableView></telerik:radgrid><asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName], [Discontinued] FROM [Products]" runat="server"></asp:SqlDataSource> </div> </form></body></html>using System;using System.Collections.Generic;using System.Collections;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "UpdateAll") { foreach (GridEditableItem editedItem in RadGrid1.EditItems) { Hashtable newValues = new Hashtable(); //The GridTableView will fill the values from all editable columns in the hash e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); SqlDataSource1.UpdateCommand = String.Format("Update Products SET Discontinued='{0}' WHERE ProductID='{1}'" , newValues["Discontinued"], editedItem.GetDataKeyValue("ProductID").ToString()); SqlDataSource1.Update(); editedItem.Edit = false; } } RadGrid1.Rebind(); } protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem && e.Item.IsInEditMode) { GridDataItem dataItem = e.Item as GridDataItem; //Hides the Update button for each edit form dataItem["EditCommandColumn"].Controls[0].Visible = false; } }}
