How to filter the NT8PropertyGrid Control view #64
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
An alternative approach may be to use the "tab" buttons to cause PropertyGrid Categories to to be collapsed/expanded as appropriate. Very simple to implement, and whilst not as visually clean as hiding the unwanted categories, the result still provides a "focused by category" view. So, for each "tab" button, collapse all categories not covered by that tab and expand all the categories covered by it. Just a thought. |
Beta Was this translation helpful? Give feedback.
-
The PropertyGrid has arrays of Categories and Properties. For example, for a declared PropertyGrid "pgrid", use pgrid.Categories and pgrid.Properties. Each of the Categories and Properties in those arrays has a boolean property of IsExpanded, which can be read or set. Having identified the Categories and Properties that correspond with individual tabs/buttons, simply cycle through all Categories and Properties and set IsExpanded to true for the ones you want to focus on and false for those you do not want to focus on. As you probably already know, you can create Categories for your Properties using [Display(GroupName = AnyGroupNameYouWant)] in your PropertyGrid class. You may also find the code for the PropertyGrid developed by Denys Vuika, the one used by NinjaTrader 8, to be of use: (https://github.com/DenysVuika/WPG) Not sure if the github version is identical to the one in NT8, but it certainly formed the basis of it. You may even find something there to help you do the hide/show you're after. ... or even support for tabs ;-) |
Beta Was this translation helpful? Give feedback.
-
Most welcome. One last comment, do take a look at this (https://github.com/DenysVuika/WPG/wiki/Display-Property-Categories-in-Separate-Tabs) to see if it may suit your purposes. |
Beta Was this translation helpful? Give feedback.
The PropertyGrid has arrays of Categories and Properties. For example, for a declared PropertyGrid "pgrid", use pgrid.Categories and pgrid.Properties. Each of the Categories and Properties in those arrays has a boolean property of IsExpanded, which can be read or set.
Having identified the Categories and Properties that correspond with individual tabs/buttons, simply cycle through all Categories and Properties and set IsExpanded to true for the ones you want to focus on and false for those you do not want to focus on. As you probably already know, you can create Categories for your Properties using [Display(GroupName = AnyGroupNameYouWant)] in your PropertyGrid class.
You may also find th…