Shift-key being ignored when ctrl-key held in either multi- or extended- selection mode. What am I doing wrong?

4 posts, 0 answers
  1. Robert
    Robert avatar
    15 posts
    Member since:
    Mar 2013

    Posted 29 Apr 2013 Link to this post

    I'm having issues with multi-selection of my treeview and I'm wondering what I'm doing wrong. I'm trying to get multi-select to work the way I expect on the RadTreeView, however I've found that every time I hold the ctrl key and shift key simultaneously, it seems to ignore the shift key and acts only in the normal ctrl key selection mode (where it selects only the item being clicked, rather than being able to click on an item with the ctrl key, then a second item with ctrl shift and select the new block, leaving any existing selection alone). Normal shift-select works as expected, and normal ctrl-select works just fine too, but ctrl-shift select just seems to work no differently than plain ctrl select, so like its ignoring the shfit key in that circumstance.

    If you've read my post history, you may have read that I was trying to override default treeview selection behavior previously, but thankfully the project specification changed to just do the default windows treeview selection style, so I removed all previous overrides of event handlers I had in place and I'm just trying to use extended selection mode.

    My xaml:

    <UserControl x:Class="LasX.ApplicationFramework.Cad.EntityTreeView"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 mc:Ignorable="d"
                 d:DesignHeight="300" d:DesignWidth="300">
        <UserControl.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="TreeViewTemplates.xaml" />               
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </UserControl.Resources>
        <Grid>
            <telerik:RadTreeView Name="treeView1"
                         HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                         telerik:TreeViewPanel.IsVirtualizing="True"
                         telerik:TreeViewPanel.VirtualizationMode="Recycling"
                         ItemTemplate="{StaticResource EntityDataTemplate}"
                         ItemsSource="{Binding CadEntityManager, UpdateSourceTrigger=PropertyChanged}"
                         ItemContainerStyle="{StaticResource RadTreeViewItemStyle1}"
                         Background="#FF212830"
                         SelectionChanged="treeView1_SelectionChanged"
                         SelectionMode="Extended"
                          >
            </telerik:RadTreeView>
        </Grid>
    </UserControl>

    Any clues as to what I may be doing wrong?

    Thanks!
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 02 May 2013 Link to this post

    Hello Robert,

    You're not doing anything wrong. Unfortunately this feature isn't implemented in the RadTreeView and therefore we logged it as a feature request in our PITS. You can vote for the item in order to increase its priority and if the item gathers enough popularity, we'll definitely consider implementing it.

    In any case, I hope that this is not a showstopper for you.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Robert
    Robert avatar
    15 posts
    Member since:
    Mar 2013

    Posted 02 May 2013 Link to this post

    Thanks Tina,

    While the answer is a little disappointing, its not a showstopper for us. In the meantime I'll just have to implement my own multi-select support by using the PreviewMouseDown event  and check to see if the shift and control keys are being held, then setting e.handled = true and handle selection manually in my code in that case.

    Thanks
    -Robert
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 03 May 2013 Link to this post

    Hello Robert,

    I'm glad to hear that this feature isn't a showstopper. And please don't hesitate to write back if you need any assistance while implementing your customizations.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top