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 am working with the MultiColumn Tree Control and it populates my parent/Child class fine but I cant find a property to enable editing. It is possible to edit with this control, right? Also, I have a column which is boolean type and it is displayed as "True" or "False". Is is possible for the column to be displayed as a checkbox instead? I know these are very basic questions, I appreciate your help. I would like to implement in Xaml rather than in the code-behind. |
|
|
In your XAML declaration of the GridViewColumn, set the CellTemplate property, e.g. <!-- In the Window.Resources section --> |
|
|
Similarly, for general editing, use a CellTemplate such as a TextBox (instead of DisplayMemberBinding). |
|
|
Thanks for the help That worked. I now have the checkbox but I am now missing how to bind it to the class property. What do I replace DisplayMemberBinding with? By the way, It is only this column that I need to be editable and I am setting the Datacontext in the codebehind.
Thanks again.
<ms:MulticolumnTreeView Name="BidCentricTree" ItemsSource="{Binding}" ItemTemplate="{ms:ChildPath ChildCol}" <ms:MulticolumnTreeView.Columns > <GridViewColumn DisplayMemberBinding="{Binding Key}" Header="Key" /> </ms:MulticolumnTreeView> |
|
|
Sorry, I left out the Xaml in my last post <ms:MulticolumnTreeView Name="BidCentricTree" ItemsSource="{Binding}" ItemTemplate="{ms:ChildPath ChildCol}" > |
|
|
You do the binding in the DataTemplate: <DataTemplate x:Key="ReticulationCheckTemplate"> That is, the template binds to the property you want to surface in the column. |
|
|
thanks. i have it now. one more question, is there a property to have the tree begin fully expanded rather than compressed?
|
|
|
No, but you can achieve this by walking the tree expanding each item. Note that because items are created by the WPF data binding infrastructure, you need to allow the binding subsystem time to run after expanding each item and before expanding its children. Something like: private static void Expand(ItemsControl parent) { Haven't tested this exact code but it should be enough get you going! |
|
|
This works for me
<Style TargetType="ms:MulticolumnTreeViewItem"> <Setter Property="IsExpanded" Value="true" /> </Style> |
|