Articles in this section
Category / Section

How to hide a particular type property in the PropertyGrid?

1 min read

HidePropertiesCollection Property:

You can hide a particular property by using the HidePropertiesCollection property in the Property Grid. Desired properties that are to be hidden can be added to the HidePropertiesCollection. For example, to hide the enum property type, this property has to be added to the HidePropertiesCollection. The following code example shows how to hide the enum property.


<syncfusion:PropertyGrid x:Name="pgrid" ButtonPanelVisibility="Visible"   
                SearchBoxVisibility="Visible" DefaultPropertyPath="Content"  SelectedObject="{Binding ElementName=button}"
                        DescriptionPanelVisibility="Visible" >
<shared:ButtonAdv x:Name="button" Label="Item" Width="100" Height="30"/>


MainWindow Class:
public MainWindow()
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        private void HideProperties(Type type)
         PropertyDescriptorCollection p = (PropertyDescriptorCollection)TypeDescriptor.GetProperties(type);
            foreach (PropertyDescriptor item in p)
                if (item.PropertyType.IsEnum)

The following screenshot hides a particular type property.

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment