We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

WinForms DataGrid - how to prevent adding new rows

ozymandias
ozymandias asked
on
Medium Priority
337 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.
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
you might also check this:

setting the AllowNew property of the DataView to false.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks. Didn't realise I had to stick a DataView between my Grid and Data to get this functionality.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.