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 trying to get my columns to autosize to a specific percentage of the controls total width. Do you have any examples of how to do this? I have tried binding the column width to the treeview actual width with a converter but that results in a binding error. <ms:MulticolumnTreeView DockPanel.Dock="Top" ItemsSource="{Binding Path=BaseFolder.Children}" x:Name="fileTree" HorizontalContentAlignment="Stretch"> Gives this error: System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'GridViewColumn' (HashCode=28756230); target property is 'Width' (type 'Double')
|
|
|
Hello Jeremy, Many apologies for not getting back to you on this -- unfortunately your message fell through the cracks somehow and we didn't pick it up until now. There's no built-in way to do this. You'll need to handle the SizeChanged event, or create a derived class and override OnSizeChanged. To keep the view definition in the XAML, you could create an attached property e.g. public class ProportionalSizingMulticolumTreeView : MulticolumnTreeView { protected override void OnSizeChanged(EventArgs e) { Then in the XAML: <local:ProportionalSizingMulticolumnTreeView> |
|