Beispiel #1
0
        protected void lnkbtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = (DataTable)ViewState["tempdocx"];
                foreach (RepeaterItem gr in RepDetails.Items)
                {
                    CheckBox chkdelete = (CheckBox)gr.FindControl("chkdelete");
                    HiddenField hdntempid = (HiddenField)gr.FindControl("hdntempid");
                    HiddenField hdndocxid = (HiddenField)gr.FindControl("hdndocxid");
                    if (chkdelete.Checked == true)
                    {
                        DataRow[] dr;
                        dr = dt.Select("tempid='" + hdntempid.Value + "'", "");
                        dt.Rows.Remove(dr[0]); ;

                        if (hdntableid.Value != "0")
                        {
                            MasterData objmst = new MasterData();
                            objmst.Docx_Delete(Convert.ToInt32(hdndocxid.Value));
                        }
                    }
                }

                ViewState["tempdocx"] = dt;
                binddocx();
            }
            catch (Exception ex)
            {
                lblerrmsg.Text = "Error: " + ex.Message;
            }
        }