trouble deleting row in GridView

J

Jeff

hi

..NET 3.5

I have a GridView which I manually add rows to, by using this code:
DataTable table;
table = (DataTable)ViewState["table"];
DataRow row = table.NewRow();
row[0] = TextBox1.Text;
table.Rows.Add(row);
GridView1.DataSource = table;
GridView1.DataBind();

When I delete a row in the grid, then this event is fired. But it generate a
StackOverFlow Exception, I'm not sure why...
protected void GridView1_Deleting(object sender, GridViewDeleteEventArgs e)
{
GridView1.DeleteRow(e.RowIndex);
}

I've not yet specified DataKeyNames

any suggestions?
 
C

comphilip

You have better give more error information. Past the error information
given by asp.net
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top