Hi,
I am using Telerik "RadDocking" control in our WPF project. I customized the "TitleTemplate" of one RadPane inside using the following DataTemplate. It basically added a RadComboBox and a RadButton besides the title. Now, whenever I pin/unpin the group pane by clicking that "Pin" button, the "SelectionChanged" event in that RadComboBox also gets fired, which is not expected since the selection is not changed in the combobox. Can you explain why this happened? Is this a bug in the control? Thanks, Jie
<
DataTemplate x:Key="WellTreeTitleTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0" Content="{Binding}" VerticalAlignment="Center" />
<tk:RadComboBox Grid.Column="1" Margin="5,4,2,4" HorizontalAlignment="Stretch"
DisplayMemberPath="Name" IsEditable="True" IsReadOnly="True"
ItemsSource="{Binding Path=DataContext.Trees, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
SelectedItem="{Binding Path=DataContext.SelectedTree, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Mode=TwoWay}"
SelectionChanged="treeComboBox_SelectionChanged" />
<tk:RadButton Grid.Column="2" ToolTip="Tree Setup" IsBackgroundVisible="False"
Margin="0,1,5,1" Width="22" Height="22" Click="treeSetupButton_Click">
<Image Source="{DynamicResource ImageWellTreeConfig24}" />
</tk:RadButton>
</Grid>
</DataTemplate>
7 Answers, 1 is accepted
Seems that the template is created every time the Pane is hidden or shown. We will need more time to research the issue and if it can be fixed, we will include it in one of our future releases. Meanwhile, I can suggest you not to use the SelectionChanged event, but to create a SelectedItem property in the ViewModel. Please find attached a sample application in which this is illustrated.
Kind regards,
Konstantina
the Telerik team
Thanks,
Jie
The issue is caused by the way the Docking control is working - every time the state of the pane is changed it is taken out from the visual tree and put into new group on the new place. That is why the template is reapplied every time the pane is pinned/unpinned. For now I can suggest you the work-around mentioned in the previous post.
Sorry for the caused inconvenience.
Best wishes,
Konstantina
the Telerik team
I know this post is quite old, but is this issue still there?
I'm using 2014.2.729.40 and have the same behavior with the RadCombobox in the RadDockingPane.
Best regards
Jürgen
The implementation of the Docking control hasn't been changed since then, so it will behave the same. However you could the approach we suggested in the previous posts of this thread.
Hope this helps.
Regards,
Kalin
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Maybe a hint in the documentation oder examples would be nice ;-)
Best regards
Jürgen
I'm glad the solution worked for you. We will consider include a note in our documentation regarding that.
If you have any other questions, let us know.
Regards,
Kalin
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.