SelectionChanged Event fire when RadPane Pin/Unpin

8 posts, 0 answers
  1. Jie Lin
    Jie Lin avatar
    8 posts
    Member since:
    Jun 2010

    Posted 22 Nov 2011 Link to this post

    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>

     

  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 25 Nov 2011 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jie Lin
    Jie Lin avatar
    8 posts
    Member since:
    Jun 2010

    Posted 28 Nov 2011 Link to this post

    OK. Let me know if you figured out if that can be fixed.

    Thanks,

    Jie
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 01 Dec 2011 Link to this post

    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 >>
  6. Juergen Holzer
    Juergen Holzer avatar
    32 posts
    Member since:
    Mar 2010

    Posted 17 Oct 2014 Link to this post

    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
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 20 Oct 2014 Link to this post

    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.

     
  8. Juergen Holzer
    Juergen Holzer avatar
    32 posts
    Member since:
    Mar 2010

    Posted 20 Oct 2014 in reply to Kalin Link to this post

    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
  9. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 21 Oct 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready