Solved

Does the datagridview RowCount include the addnew row?

Posted on 2006-06-13
1
856 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
1 Comment
 
LVL 34

Accepted Solution

by:
Sancler earned 250 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now