Is it possible to make a DGV control read only, i.e. End user can't change details or add new items, but still enable it to be updated via code :confused:
Printable View
Is it possible to make a DGV control read only, i.e. End user can't change details or add new items, but still enable it to be updated via code :confused:
This is a perfect example of why you should ALWAYS read the documentation first. If you'd done that, you'd have seen that the DataGridView class has a ReadOnly property. You could have seen that property with a quick look in the Properties window too. It's purpose seems fairly self-explanatory but, if you need more, you can always read about it.
Thanks for the answer, works exactly as required.
Sorry don't have hours and hours to read manuals, look at every possible property, or count the number of angels on the tip of a pin, this is secondary stuff to my main heavy duty programming.
RTFM, why then would we possibly need this forum as the manual and stackoverflow would suffice for requirements?
That's a ridiculously gross exaggeration, which you're making to justify your lack of effort. If you can pretend that it was really hard then it's OK not to have done it. The problem is that it would have taken you minutes at the most to find the property in the Properties window. You may not have hours and hours to read the manuals but, fortunately, that would never be a requirement. Lucky you.
Sites like this and, in fact, Stack Overflow are for the hard stuff that you can't work out on your own, not for the easy stuff that you can't be bothered to work out on your own. If all you need is this site then what is the manual for? Oh, that's right, it's people who actually do read the manual, or at least glance at the Properties window, who answer the questions.
That's a ridiculously gross exaggeration, which you're making to justify your lack of effort. If you can pretend that it was really hard then it's OK not to have done it. The problem is that it would have taken you minutes at the most to find the property in the Properties window. You may not have hours and hours to read the manuals but, fortunately, that would never be a requirement. Lucky you.
Sites like this and, in fact, Stack Overflow are for the hard stuff that you can't work out on your own, not for the easy stuff that you can't be bothered to work out on your own. If all you need is this site then what is the manual for? Oh, that's right, it's people who actually do read the manual, or at least glance at the Properties window, who answer the questions. Apart from that, it's not even manual as such. The Microsoft Docs site is searchable and hyperlinked and you can go straight to a specific topic from VS with the F1 key. It's use takes little effort, but even that is still some effort.