?
Solved

Does the datagridview RowCount include the addnew row?

Posted on 2006-06-13
1
Medium Priority
?
878 Views
Last Modified: 2009-12-16
Background:
VS 2005
I'm using a datagridview to store some data which I populated through a OdbcDataReader.  I loop through the rows and perform a delete (on certain rows) using:
dgvDBF.Rows.RemoveAt(intRow)
The last record reports the following error:
      Uncommitted new row cannot be deleted.

The only reason I can figure why I'm getting the error is if the Add New Row is included in the datagridview rowcount property.  Since I can't base code on a hunch I'm looking for some confirmation.

Cheers.
0
Comment
Question by:nebbles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 34

Accepted Solution

by:
Sancler earned 1000 total points
ID: 16898656
Yes, the dgv's RowCount (or its Rows.Count) does include the row in which a new entry can be made - the "Add New Row" - if such a row exists: that is, if AllowUserToAddRows = True

Roger
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question