Problem with row that adds new rows in DataGridView

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2008
Posts: 24
Reputation: matejkralik is an unknown quantity at this point 
Solved Threads: 0
matejkralik matejkralik is offline Offline
Newbie Poster

Problem with row that adds new rows in DataGridView

 
0
  #1
Sep 17th, 2008
Hey professionals, I use DataGridView that allows me to add new rows in table. But when I want to delete it by clicking on my deleting button with following code:

DataGridView.Rows.RemoveAt(DataGridView.CurrentCell.RowIndex);

...it makes problems, others rows aren't problematic to delete but this is. But not on purpose I want to delete this row for adding new rows of the table, but only to prevent some coincidental clicking on the button.

...this table of DataGridView is filled by Dataset which is filled by xml file.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 58
Reputation: vckicks is an unknown quantity at this point 
Solved Threads: 9
vckicks vckicks is offline Offline
Junior Poster in Training

Re: Problem with row that adds new rows in DataGridView

 
0
  #2
Sep 17th, 2008
if you are talking about the default blank row at the bottom of all the rows then you have to turn off the property AllowUserToAddRows.

Since it is not a real row you cannot delete it.
Visual C# Kicks - Free C# code resources and articles.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 65
Reputation: Renukavani is an unknown quantity at this point 
Solved Threads: 6
Renukavani Renukavani is offline Offline
Junior Poster in Training

Re: Problem with row that adds new rows in DataGridView

 
0
  #3
Sep 24th, 2008
hi
if u want to delete selected row means, the code s
dataGridView1.Rows.RemoveAt(dataGridView1.CurrentRow.Index);

for Add rows
dataGridView1.Rows.Add(10,10);
adding value s depending upon u


if its working fine plz mark as RESOLVED
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC