hai friend's

i have a gridview ,i bind the data's in gridview by using DataBinder, so when i going for dalete option , i using the checkbox to check that and using the find control option

to find the selected row and to delete .n that following r the code i used


note: chk is the checkbox id.

for (i=0;i<gridview1.rows.count;i++)
{
gridview grd =  (gridview).gridview1.rows[i];

checkbox cek = (checkbox)grd.fincontrol("chk");

if(cek.checked)=true)
{
string del = cek.cells[1].Tostring();

the as usual connection and the delete query

my problem is that while cheking the cells it execute the error ,

help me guys

i think u r having syntax error in if(chk.checked).
see that first.

if u want code to delete a row u can use this

for(int i=0;i<=gridview1.rows.count-1;i++)
{
checkbox chk=new checkbox();
chk=(checkbox)gridview1.rows[i].findcontrol("chk_name");
if(chk.checked)
{
string del=use u r code;
}

}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.