Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WinForms DataGrid - how to prevent adding new rows

Posted on 2006-10-31
3
Medium Priority
?
321 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
[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
  • 2
3 Comments
 
LVL 143

Expert Comment

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

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 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