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

ComboBox with CheckBox items

1 Answer 145 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kirk Quinbar
Top achievements
Rank 1
Kirk Quinbar asked on 02 May 2011, 04:34 PM
hi,

I have created a radcombobox that supports checking multiple items via checkboxes. there are several examples here on the forum and i kinda used a combination of ideas for my version. since the radcombobox only supports selection of one item at a time, i decided that i would make use of the EmptyText property to display information about what is currently checked (i.e. All Items, Single item, x items selected) and this works great, but the one issue i have is that if a user clicks to the right of the text for a checkbox in the dropdown list, the action is that the radcombobox will then make that item its currently selected item instead of just checking the checkbox. I am thinking this is because the checkbox is not as wide as the listbox parent. take a look at the attached image to see the area in red box that you can click on which will just change the radcombobox selected item instead of checking the item.

every example of a multiple select radcombobox (using checkboxes) that is on this forum seems to have this same issue, so I dont know if this is really a radcomboxbox issue or a checkbox issue, but maybe someone can shed some light?

- any ideas on how to make the checkbox as wide as the list it is contained in so that clicking anywhere to the right of the text would still check the item?
- or is this a scenerio where i need to actually change the control template for the radcombobox?

a working example would be appreciated.

<telerik:RadComboBox 
    ItemsSource="{Binding Employees}"
    EmptyText="{Binding SelectedEmployeeText}"
    telerik:TextSearch.TextPath="DisplayName"
    HorizontalAlignment="Left" 
    Margin="78,100,0,0" 
    x:Name="radComboBox1" 
    VerticalAlignment="Top" 
    Width="250" >
    <telerik:RadComboBox.ItemTemplate>
        <DataTemplate>
            <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Content="{Binding DisplayName}" />
        </DataTemplate>
    </telerik:RadComboBox.ItemTemplate>
</telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 04 May 2011, 12:11 PM
Hi Kirk,

Thank you for your question.

Unfortunately, this is the best that can be achieved with the ComboBox for now. We are working on implementing the checkable feature and once there is a working beta version we will publish it for testing.

Hope this information helps.

Greetings,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Kirk Quinbar
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or