Delete gridview row inside repeater by javascript onclient click in asp.net

//Add this in c# code to add client event in button then write your delete code on repeater itemcommand
protected void GrdImageDetail_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                (e.Row.FindControl("lnkDelete") as LinkButton).OnClientClick = "return DeletegrdIndustrySplFiles('" + (rptAccordian.Items[e.Row.RowIndex].FindControl("GrdImageDetail")).ClientID + "','" + e.Row.RowIndex.ToString() + "');";
            }
        }

//javascript to delete row from client side

 function DeletegrdIndustrySplFiles(gridclientid, rowindex) {
            var gridID = document.getElementById(gridclientid);
             gridID.deleteRow(parseInt(rowindex) + 1);
           
           // return false;
        }


Comments

Popular posts from this blog

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths