This is a migrated thread and some comments may be shown as answers.

SelectionChanged Event fire when RadPane Pin/Unpin

7 Answers 260 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jie Lin
Top achievements
Rank 1
Jie Lin asked on 22 Nov 2011, 09:30 PM

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

Sort by
0
Konstantina
Telerik team
answered on 25 Nov 2011, 12:32 PM
Hello Jie,

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
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Jie Lin
Top achievements
Rank 1
answered on 28 Nov 2011, 09:14 PM
OK. Let me know if you figured out if that can be fixed.

Thanks,

Jie
0
Konstantina
Telerik team
answered on 01 Dec 2011, 02:51 PM
Hi 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
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Juergen Holzer
Top achievements
Rank 2
answered on 17 Oct 2014, 12:54 PM
Hello!

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
0
Kalin
Telerik team
answered on 20 Oct 2014, 07:49 AM
Hi 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.

 
0
Juergen Holzer
Top achievements
Rank 2
answered on 20 Oct 2014, 08:53 AM
Thank you for the reply! I've implemented the Workaround and it's working as expected.
Maybe a hint in the documentation oder examples would be nice ;-)

Best regards
Jürgen
0
Kalin
Telerik team
answered on 21 Oct 2014, 08:01 AM
Hello 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.

 
Tags
Docking
Asked by
Jie Lin
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Jie Lin
Top achievements
Rank 1
Juergen Holzer
Top achievements
Rank 2
Kalin
Telerik team
Share this question
or