ExtendedMode Multiselect with shift Selects un-selectable items

5 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 30 Oct 2013 Link to this post

    So, this is a Silverlight known bug they won't fix, but I'm wondering if there would be any workaround with Telerik and the RadListBox vs the regular Listbox?  (I'm guessing no).


    https://connect.microsoft.com/VisualStudio/feedback/details/675390/silverlight-using-shift-in-extended-selection-mode-in-a-listbox-does-not-honor-disabled-listboxitems#tabs

  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 04 Nov 2013 Link to this post

    Hi Dan,

    This issue doesn't exist in RadListBox - I've attached a sample project for your convenience. Could you give it a try and inform us in case you have any problems or concerns?

    Hope this helps.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 05 Nov 2013 Link to this post

    I can't use isEnabled though.  I want to use IsHitTestVisible which doesn't work in a template like below.  Well I guess I could use isEnabled if it's not grayed out.  

    I use it in a template like below
    <telerik:RadListBox Name="rlbTemplate" Height="300" SelectionMode="Extended">
        <telerik:RadListBox.Resources>
            <Style  TargetType="ListBoxItem" >
                <Setter Property="IsHitTestVisible" Value="{Binding isHitTestVisible}"/>
            </Style>
        </telerik:RadListBox.Resources>
     
        <telerik:RadListBox.ItemTemplate  >
            <DataTemplate   >
                <TextBlock Text="{Binding Display}" />
            </DataTemplate>
        </telerik:RadListBox.ItemTemplate>
    </telerik:RadListBox>
    namespace RadListBox_SL_753414
    {
        public class largeObject
        {
            public string Display
            { get; set; }
     
            public bool isHitTestVisible
            { get; set; }
        }
        public partial class MainPage : UserControl
        {
            public MainPage()
            {
     
     
                InitializeComponent();
                List<largeObject> llo = new List<largeObject>();
                for (int i = 0; i < 100; i++)
                {
                    largeObject lo = new largeObject();
                     
                     lo.Display="item number: "+ i;
                     if (i % 5 == 0)
                     {
                         lo.isHitTestVisible = false;
                     }
                     else
                     {
                         lo.isHitTestVisible = true;
                     }
                     llo.Add(lo);
                      
                }
                rlbTemplate.ItemsSource = llo;
               // rlbTemplate2.ItemsSource = llo;
     
            }
        }
    }
  5. Answer
    Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 08 Nov 2013 Link to this post

    Hi Dan,

    Using IsHitTestVisible is not an option in such scenario - one item could be selected, but with IsHitTestVisible to false. If you want to modify the Disabled state, you have to modify RadListBoxItem template - if you remove the Disabled state from the VisualStates, the disabled items will look just like all the other items.

    I've modified the sample project to show you how to achieve this. The modified implicit style is in App.xaml. Could you give it a try and inform us in case you have any problems or concerns?

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 08 Nov 2013 Link to this post

    Yes this works great, Thank you
Back to Top
DevCraft banner