How do I disable a PropertyGrid item at runtime

M

mudassirahmed368

How do I disable a PropertyGrid item at runtime. i am using this on
windows form.and want only few items to be editable to the user.other
items should be disabled
 
D

Dmytro Lapshyn [MVP]

Hi,

Most likely, you'll have to implement the ICustomTypeDescriptor interface,
and in its GetProperties method, return a collection of PropertyDescriptor
objects in which for all the properties that should be disabled in the
property grid, the ReadOnly property would be set to "true".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top