or


<form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager" runat="server"></telerik:RadScriptManager> <telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server"> <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" OnNeedDataSource="RadGrid1_NeedDataSource"> <MasterTableView AutoGenerateColumns="True" ClientDataKeyNames="Id" DataKeyNames="Id" CommandItemDisplay="Top"> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="True"></Selecting> <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> </ClientSettings> </telerik:RadGrid> <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" onclick="RadButton1_Click"> </telerik:RadButton> </telerik:RadAjaxPanel> </form>private Dictionary<int, string> GridSource{ get { return (Dictionary<int, string>) ViewState["gridSource"]; } set { ViewState["gridSource"] = value; }}protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { GridSource = new Dictionary<int, string>(); for (int i=0; i<2; i++) { GridSource.Add(i, "test data " + i); } }}protected void RadButton1_Click(object sender, EventArgs e){ GridSource.Remove(int.Parse(RadGrid1.SelectedItems[0].Cells[2].Text)); RadGrid1.Rebind();}protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ RadGrid1.DataSource = from d in GridSource select new { Id = d.Key, Text = d.Value };}Server Error in '/' Application. ________________________________________The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /_CONTROLTEMPLATES/Hojan.KMS.Webparts/KnowledgeEntry/Telerik.Web.UI.DialogHandler.aspx