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.

PropertyGrid expand all properties and property order

Thread ID:

Created:

Updated:

Platform:

Replies:

128688 Feb 6,2017 05:05 AM Sep 20,2018 01:49 AM WPF 3
loading
Tags: PropertyGrid
Bojan
Asked On February 6, 2017 05:05 AM

Hi.
Is there any way to expand all nodes in PropertyGrid by code (expandMode is set to NestedNode)?
It's possile to set custom order of properties? For example xceed property grid has a PropertyOrder attribute which i can defne it per class property. Is there any similar way of doing this, displaying property c, a, b instead of a, b, c.?

Thanks

Keerthana Jegannathan [Syncfusion]
Replied On February 7, 2017 08:19 AM

Hi Bojan, 
 
Thanks for contacting Syncfusion support. 
 
Query 1: Is there any way to expand all nodes in PropertyGrid by code (expandMode is set to NestedNode)? 
 
In PropertyGrid, at present there is no default support to expand all the nodes be code behind. We have prepared a workaround sample in which we have iterate through the PropertyViewItem and expand it based on the ToggleButton visibility and it can be downloaded from the below location. 
 
 
Query 2: It's possile to set custom order of properties? For example xceed property grid has a PropertyOrder attribute which i can defne it per class property. Is there any similar way of doing this, displaying property c, a, b instead of a, b, c.? 
 
We have considered your requirement as feature and it will be available in any of our upcoming releases. Please check our website periodically to know the features that are implemented.

Regards,
Keerthana J 


ibK
Replied On September 19, 2018 04:39 AM

Try to do this in a own PropertyGrid class, but dont work:

using System;
using System.Windows;
using System.Windows.Controls.Primitives;
using Syncfusion.Windows.PropertyGrid;
using Syncfusion.Windows.Shared;

namespace ibKastl.MD3.Gui.UserControls.PropertyGrid
{
  class MD3PropertyGrid : Syncfusion.Windows.PropertyGrid.PropertyGrid
  {
    public MD3PropertyGrid() : base()
    {
      Loaded += OnLoaded;
    }

    private void OnLoaded(object sender, RoutedEventArgs e)
    {
      if (VisualUtils.FindDescendant(this, typeof(PropertyView)) is PropertyView item)
      {
        item.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
      }
    }

    private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
    {
      foreach (PropertyCatagoryViewItem item in VisualUtils.EnumChildrenOfType(this, typeof(PropertyCatagoryViewItem)))
      {
        item.IsExpanded = true;
        foreach (var items in item.Items)
        {
          foreach (PropertyViewItem propertyviewitem in VisualUtils.EnumChildrenOfType(this, typeof(PropertyViewItem)))
          {
            ToggleButton button = (ToggleButton)propertyviewitem.Template.FindName("PART_Toggle", propertyviewitem);
            if (button.Visibility == System.Windows.Visibility.Visible)
            {
              button.IsChecked = true;
            }
          }

        }
      }
    }
  }
}


Senthil Kumaran Rajan [Syncfusion]
Replied On September 20, 2018 01:49 AM

Hi IbKastal 
 
Thank you for the update 
 
We have checked the reported query that the code for expand all nodes is not working in propertygrid. We have checked the same, by creating the custom class of PropertyGrid, but the code for expanding all nodes of properties in PropertyGrid is working fine at our end. Please find the sample for the same from following location: 
 
 
Screenshot: 
 
 
 
Please check with this sample and screenshot and let us know whether you are meant about this? If not, please brief about the case in which you are facing the issue, it would be helpful for us to proceed on this.  
 
Regards, 
Senthil 


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.

;