1) first of all make modification on your select data query for gridview to display only those records which having
IsDeleted = false
select......
.........
Where IsDeleted = 0
2) second create a web method which will called by clicking on your gridview's button click, and that web method is responsible to change your database table record related to Is Delete flag. call that web method using jquery ajax call, and on sucess of ajax call, find your gridview row and set it's css property to
display none
or something like that to hide the row.
[System.Web.Services.WebMethod]
public static string SetIsDeleted(string id)
{
}
<script type = "text/javascript">
var id = 1; --write your own logic to get id for which you need to set IsDeleted flag
function ShowCurrentTime() {
$.ajax({
type: "POST",
url: "Default.aspx/SetIsDeleted",
data: '{id: "'+ id + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function(response) {
alert(response.d);
}
});
}
function OnSuccess(response) {
}
</script>
please check
link[
^] to check how to define and consume web method of aspx page.
Also please check this
Link[
^] too, that article is demonstrating how to delete record from gird view as well as database, you just need to follow all the steps and change logic just like instead of deleting record you need to write your query in such a way to just set IsDeleted column value.