datagrid deletecommand calling on each refresh

C

CreativeMind

hi,
can u help me plz,
i have a remove link , when i click the remove link of first record,
it should remove the clicked record. it is doing well but when i
refresh , every time, this event is triggered. and every time, it
removes the first record. means, i have 10 items, then 10 times
refresh makes it empty.. how can i stop that.

private void dgPropertyImages_DeleteCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string fileNameToRemove = this.dtImageFiles.Rows[e.Item.ItemIndex]
[2].ToString();
this.dtImageFiles.Rows.RemoveAt(e.Item.ItemIndex);
}


thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top