Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3220
XamPropertyGrid FilterAreaVisibility="Collapsed" not working
posted

Hello,

when using XamPropertyGrid with DarkMetroTheme the FilterAreaVisibiltiy="Collapsed" is not working. When set, it still shows the Filter and Sorting row.


                                    FilterAreaVisibility="Collapsed"
                            OptionsMenuVisibility="Collapsed"
                            DescriptionAreaVisibility="Collapsed"/>
   

I am using v16.1

  • 34430
    Offline posted

    Hello Markus,

    I have been investigating into this behavior you are reporting, and I have reproduced it. It appears that there is a missing TemplateBinding in the default template for the XamPropertyGrid in the MetroDark theme.

    Normally, to work around this, I would recommend writing a Style for the primitive PropertyGridFilterAreaControl element, as this is ths "Filter Area" in the XamPropertyGrid, and setting its Visibility property to "Collapsed" would normally collapse it. While it does, it appears that there is still some Height to the Grid that contains this element, and so you end up with a margin at the top of the grid.

    In order to work around this, I would recommend including the default MetroDark XamPropertyGrid theme file and any dependencies it has. This file is named MetroDark.xamPropertyGrid.xaml and can commonly be found at the following directory:

    C:\Program Files (x86)\Infragistics\<your version here>\WPF\Themes\MetroDark\

    After including it and any dependencies that it has, I would recommend locating the default style for XamPropertyGrid and inside it, a Grid with a Margin of 6 pixels and containing a PropertyGridFilterAreaControl element. If you add the following tag to it and merge the MetroDark.xamPropertyGrid.xaml dictionary with your XamPropertyGrid.Resources collection, you can ensure that the FilterAreaVisibility property is respected:

    <Grid Grid.Row="0" Margin="6" Visibility="{TemplateBinding FilterAreaVisibility}" />

    This is unexpected behavior, and as such, I have asked our engineering staff to examine it further. To ensure it receives attention, I have logged it in our internal tracking systems with a development ID of 242739. I have also created you a support case so that you can track this issue. It has a development ID of CAS-187333-X2H6D7 and you can access it at https://www.infragistics.com/my-account/support-activity after signing into your account on the website.

    I have also attached a sample project to demonstrate the above workaround. I hope this helps.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer