Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I can open an record in Window application form by fetching it from datagridview but i want two different modes 1) editable 2) View mode.
In Detail: 1) If combobox4 having value is "open" then user can edit the values in the form. 2) If the combobox4 having value is "closed" then user cannot do any change in existed record in the form.
Posted

1 solution

Set the ReadOnly property to True when you do not want the DataGridView to be editable and to False when it should be editable.

See DataGridView.ReadOnly Property[^]
 
Share this answer
 
Comments
Member 11134954 17-Jun-15 2:24am    
I want the effect on form...
Mike Meinz 17-Jun-15 5:30am    
TextBoxes, ComboBoxs and other form elements all have an Enabled property. Toggling Enabled to False effectively makes that control "ReadOnly".

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