Solved

Disallowing insert and delete of rows in a winforms datagrid

Posted on 2004-09-15
2
221 Views
Last Modified: 2010-04-23
I am using a winforms datagrid to display data from a database. I wish to allow the user to modify the existing records and save the changes, but NOT delete or insert any records.

I am currently using the grid with the ReadOnly property set to False.

This works well for the modifying of existing records, but there is still a "New Row" (displayed with a * on the left hand side) at the bottom of the grid.

Does anybody know how to remove this row from the grid and still keep the ReadOnly property set to False??

Thanks.

0
Comment
Question by:quickly_james
[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 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 125 total points
ID: 12072367
Yes use a dataview as your datasource then you can do stuff like

dim dv as new dataview = ds.tables(0).defaultview
dv.allownew = false
dv.allowedit = true
dv.allowdelete = false

datagrid1.datasource = dv


0
 

Author Comment

by:quickly_james
ID: 12072392
Thanks Ronald!
0

Featured Post

Independent Software Vendors: 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 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