Solved

Does the datagridview RowCount include the addnew row?

Posted on 2006-06-13
1
864 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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