Hi,
I want to delete gridview row on selected checkbox.
Suppose I have 10rows in grid and checkbox also. I want to delete those rows which checkbox were checked.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Om prakash SinghPosted Jul 15, 2011, 8:57 AM
DataRow dr;
for (i = ds_xml.Tables[xmltable].Rows.Count -1; i >= 0; i--)
{
dr = ds_xml.Tables[xmltable].Rows[i];
if(dr[0].ToString() != Ops.ToString())
ds_xml.Tables[xmltable].Rows.Remove(dr);
}
This will not delete data from database but from user interface
Jiteendra SampathiraoPosted Jul 13, 2011, 3:51 AM
I hope you seen my referred links...
To achieve this functionality your database table Should have status column. set the default value '1' to it.
At the place of Delete query you need to write update query to change the status value to '0'.
And then call the Gridview_filling. there write the select query like
Select a,b,c,d,e,f from data_table where status=1;
you need to customize the whole coding....
i hope you got some idea...
Sahil JaniPosted Jul 13, 2011, 3:22 AM
Thanks to all.
But I dont want to delete this gridrow from the database.
I just want to delete it from userInterface only.
Jiteendra SampathiraoPosted Jul 13, 2011, 3:16 AM
refer this link:
Link1
Link2
i hope it works for you....
Om prakash SinghPosted Jul 13, 2011, 3:15 AM