using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class Delete_ServerConfirm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            Session["DeleteCandidateItem"] = e.Item;

            string radalertscript = "<script language='javascript'>function f(){ radconfirm('Are you sure ', confirmClearSingleCallBack, 400, 100) ; Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);

            e.Canceled = true;
        }
        else if (e.CommandName == "ConfirmDelete")
        {
            GridDataItem item = Session["DeleteCandidateItem"] as GridDataItem;
            if (item != null)
            {
                RadGrid1.MasterTableView.PerformDelete(item, false);
            }
        }
    }
}