Discussion Locked

Adding and Changing Record in DataGrid

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I desperately need help from all of you. My problem is DataGrid related.

The situation is as follow: I have three command button in the form that is the Add, Change and Cancel...

1. How can I restrict the user to only add new record, when theyclick the Add button. (I was using AddNew Method). How to make the existing record to be read only and while the new record can be added...

2. I truly understand that when the user enter the data into the datagrid, all the data will be directly updated to the database. How would I reverse or clear off the new record added when the user click the Cancel button. Is there any function to undo the updated data to clear the newly added/ edited records into the database

These two problems really drive me mad. I wish that I could get help from the expert (I mean all of you). Your help and kindness will be mostly appreciated...

5 replies

by aon

To answer this question more infromation is required - for a start, what language / development environment are you using?

- A.

by lord ago 1

Assuming you're using Visual Basic, you would do this by setting the properties of the DataGrid. Uncheck things like AllowAddNew, AllowUpdate, and AllowDelete.
A good way to use the cancel is to use "MoveLast","Delete","Refresh". This will erase the last entered record.Have Fun!!

This discussion is closed to new replies.