This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I added groups to property grid Grouping="{x:Static ms:PropertyGrouping.ByCategory}" But would like completely hide/restore some groups based on condition. Is categories filtering possible? |
|
|
You would probably need to re-template the grid and create a custom GroupStyle with a custom ControlTemplate for GroupItem. (See the new styles included with version 2.0 of the grid for example source code.) In that ControlTemplate, set the Visibility of the outermost element (typically a Border or an Expander) to Visible or Collapsed depending on your filtering criterion. Depending on the kind of condition you want, you may also find it useful to create a custom GroupDescription so that the group "name" can carry richer information than just the display text. |
|
|
i dont have source code for version 2.0 styles. can you please provide Blue PropertyGrid template? I expected may be you will implement the same behavoir for filtering as for properties
SetCategoryGridFilter(delegate(string category) { return category.Match(....) } |
|
|
Version 2 is a free upgrade which you can get from the store, and installs side-by-side with version 1 so it won't overwrite your existing version. The source for the styles is included in all editions (you do not need Enterprise), in the installation directory under Source / Styles. |
|
|
i found poppy.xaml which retemplates GroupItem. Unfortunately that template doesnt allow to edit nested objects. Replace poppy.xaml.cs // TemplatedGrid.SelectedObject = new Preferences(); ====>>>>> Notice that HomePhone and WorkPhone nodes cant be expanded anymore
|
|
|
In the v2.0 installation directory, you should have a folder named Source, and within that a folder named Styles. (If you don't have these, check that you are looking at the v2 directory rather than the v1 directory.) The XAML files in there are fully functional and therefore much more comprehensive than the Templating sample: they allow editing of nested objects and they also retemplate GroupItem. For example, in Blue.xaml the GroupItem template appears on line 508. Hope this helps! |
|