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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Om prakash Singh126 reputationPosted Jul 12, 2011, 11:15 PM EDT
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 12, 2011, 11:16 PM EDT
refer this link:
Link1
Link2
i hope it works for you....
Sahil Jani196 reputationPosted Jul 12, 2011, 11:22 PM EDT
Thanks to all.
But I dont want to delete this gridrow from the database.
I just want to delete it from userInterface only.
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 12, 2011, 11:51 PM EDT
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...
Om prakash Singh126 reputationPosted Jul 15, 2011, 4:57 AM EDT
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