Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > trouble deleting row in GridView

Reply
Thread Tools

trouble deleting row in GridView

 
 
Jeff
Guest
Posts: n/a
 
      12-31-2008
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?


 
Reply With Quote
 
 
 
 
comphilip
Guest
Posts: n/a
 
      01-04-2009
You have better give more error information. Past the error information
given by asp.net

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView DataBinding to a DataTable and row deleting problems Andy B ASP .Net 0 04-30-2008 04:42 AM
Gridview row databound event - can't get past the 1st row of gridview maurban@gmail.com ASP .Net 5 10-13-2006 09:37 PM
Deleting row from GridView causes ArgumentOutOfRangeException during System.Web.UI.WebControls.GridView.set_SelectedIndex(Int32 value) loga123 ASP .Net 2 06-28-2006 08:32 PM
GridView nested in DataList - refreshing corresponding DataList row after updating GridView row H5N1 ASP .Net 0 04-26-2006 11:41 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57