Solved

WinForms DataGrid - how to prevent adding new rows

Posted on 2006-10-31
3
316 Views
Last Modified: 2008-02-01
I have a dataGrid on a winfows form which is bound to a data set.
It works fine and I want users to be able to edit the values in the grid.
However, there is always an extra line at the bottom which when clicked on allows the adding of a new row.
How can I stop this ?
Is it set in the DataGrid or in the underlying data source.
I know I can stop new rows being commited to the dataset, but what I really want is for this extra data entry line to not even appear in the grid.

Cheers.
0
Comment
Question by:ozymandias
  • 2
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17840760
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 300 total points
ID: 17840762
you might also check this:

setting the AllowNew property of the DataView to false.
0
 
LVL 15

Author Comment

by:ozymandias
ID: 17840815
Thanks. Didn't realise I had to stick a DataView between my Grid and Data to get this functionality.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 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