Search code examples
c#asp.netteleriktelerik-radlistbox

Disable selection from Radcombobox list of values


I want to list all the items in the radcombobox (Values are binded from dataset) but user should not be allowed to select any value from radcombobox.

User should able to see all the items but selecting an item should be disabled.

I would appreciate any help. Thanks in advance.


Solution

  • You can do it in aspx part of the page. Right in this way.

    <telerik:RadComboBox x:Name="radComboBox" Width="200">
            <telerik:RadComboBoxItem Content="Alapattah" IsEnabled="False"/>
            <telerik:RadComboBoxItem Content="Brickell Avenue" />
            <telerik:RadComboBoxItem Content="Downtown Miami" IsEnabled="False"/>
        </telerik:RadComboBox>
    

    But if you are binding it programatically, you can do something like this:

    foreach(RadComboBoxItem item in radComboBox.Items)
    {
        item.Enabled = false;
    }
    

    Then in both cases user can view, but can't select disabled items.

    More info is here: http://docs.telerik.com/devtools/wpf/controls/radcombobox/howto/enable-disable-radcombobox-items