Click here to Skip to main content
14,930,405 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello All ,

I have developed one C# windows application to enter member collection in database through CSV file.

I am using one datagridview to add those member name which are not register in database same like QUICK REGISTER . I am prompting user that listed members id in data grid is missing in database .

I want to provide the lock to this grid for the following issues :
1) grid have two column ID and name . here ID is non-changeable parameter
but still user can change it because id cell is editible. I tried to set Editable property of grid to true but it also restrict user to changes or enter member name.
2) Whenever user click on name name to change it. Grid itself add one blank row at the end.

Please let me know how to overcome this issues.

Thanks in advance.
Updated 18-Apr-11 21:16pm
RDBurmon 18-Apr-11 11:34am
First issue is resolved now . I did set readonly property to true . thanks to
RDBurmon 18-Apr-11 11:35am
Please let me know about second issue.

1 solution

Set AllowUserToAddRows to False.
RDBurmon 18-Apr-11 12:18pm
Thanks for quick reply . I tried this option but it removes all the rows which I have added through . I need those rows to be display to user. Please do suggest in same way...
Oshtri Deka 18-Apr-11 16:20pm
Add new rows with separate method. It isn't nicest solution, but it works.
RDBurmon 19-Apr-11 1:24am
Thanks Oshtri , I think you have got some confusion by reading comments .I suspect to read the original question and provide me right solution.
RDBurmon 19-Apr-11 1:38am
Thanks Abhinav , Previosuly I had added the rows in grid and then set up this property to falso which causes deletion of rows . Now I did to set this property to falso at first and then I have added the rows which result into what I actually need .
Abhinav S 19-Apr-11 1:58am
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900