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
|
Hi- Is there a way to specify that some properties should be expanded by default when displayed, so that the user doesn't have to click the expand + sign every time? Thanks. |
|
|
There isn't an easy way to do this from "inside" the grid, but you can do it by calling a method after you set SelectedObject. This would go something like this: public void ExpandAutoExpandProperties() Notes: I have omitted error handling. This is quite important as the grid template is applied only during window load. So if you call this from the window constructor, FindName will return null. You would need to defer calling the method until, e.g. the Loaded event fires. (There are ways around this but they involve subclassing the grid; let me know if you want more info.) This only checks the top level for autoexpanding nodes. If you want to autoexpand nodes further down the tree, you will need to recurse into tlvi.Items. |
|
|
I already subclassed the grid from instructions in the Autosizing left column width post. So I just used
TreeListView treeListView = GetTemplateChild("PART_Grid") as TreeListView;
Works great. Thanks! |
|