0

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.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Renukavani
0

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.