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

Disable Selection for Some of the dropdown items

2 Answers 224 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Shengwei
Top achievements
Rank 1
Shengwei asked on 13 Jun 2013, 09:10 AM
Hi, 

I want to know if there is anyway i can DISABLE a selection for a particular item in the dropdown list?

i have a list of objects bind to the dropdown list, and i want to disable some of the items from selection using data trigger based on one of the object's property.

thanks
 

2 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 18 Jun 2013, 11:37 AM
Hi Shengwei,

I'm afraid that currently there isn't a straightforward approach to achieve the described scenario.

Thank you for your feedback, we will consider this particular case for the future releases of the control.

Regards,
Kalin
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Shengwei
Top achievements
Rank 1
answered on 21 Jun 2013, 01:50 AM
Thank you for your reply.

Currently i had a "half" working solution which is to set the styling of RadListBoxItem since the dropdown is a radlistbox

<modules:AutoCompleteItemToFocusableConverter x:Key="ac2fConverter"/>
<Style TargetType="telerik:RadListBoxItem">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Converter={StaticResource ac2fConverter}}" Value="False">
            <Setter Property="IsHitTestVisible" Value="False"/>
        </DataTrigger>
    </Style.Triggers>
</Style>

but the above doesnot prevent the keydown selection however it does prevent cursor selection.

or we can using 

<Setter Property="IsEnabled" Value="False"/>

however the styling of the individual item will be gone since it is disabled, i need to overwrite the default style for the disalbed.


but thanks for your reply 

Tags
AutoCompleteBox
Asked by
Shengwei
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Shengwei
Top achievements
Rank 1
Share this question
or