We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hiding properties of the SelectedObject in the PropertyGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

121235 Nov 20,2015 07:02 PM Nov 24,2015 12:04 AM WPF 3
loading
Tags: PropertyGrid
Alessandro Del Sole
Asked On November 20, 2015 07:02 PM

Hi,
I have a class that is assigned as the SelectedObject of the PropertyGrid control. Is there a way to hide some of my class' properties from being displayed in the PropertyGrid? There are some values I supply by default and I do not want users to be able to change them.

Thanks in advance.
Alessandro

Venkateshwaran Ramdoss [Syncfusion]
Replied On November 23, 2015 04:37 AM

Hi Alessandro,

Thank you for contacting Syncfusion Support.

Query#1:" Is there a way to hide some of my class' properties from being displayed in the PropertyGrid?"

Yes, In our PropertyGrid the particular property can be hide by using "HidePropertiesCollection". Please refer the below KB to hide the property in PropertyGrid.

Link: https://www.syncfusion.com/kb/3859/how-to-hide-a-particular-type-property-in-the-propertygrid

Query#2:"Given value by default do not want users to be able to change them?"

We can avoid editing the property value by using "ReadOnly" attribute. We have created a sample with "ReadOnly" attribute. In tihs sample we have hide the property "Name" and we have used ReadOnly property for "Area" and "Mobile".

Please download the sample from below.

Sample:PropertyGridSample

Please let us know if you need further assistance.

Regards,
Venkateshwaran V.R.

Alessandro Del Sole
Replied On November 23, 2015 12:18 PM

Thank you so much, this really helped.

Alessandro

Venkateshwaran Ramdoss [Syncfusion]
Replied On November 24, 2015 12:04 AM

Hi Alessandro,

We are glad that your issue has been resolved.
Please let us know if you need any other assistance.

Regards,
Venkateshwaran V.R.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;