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

Keep Combobox Open

2 Answers 254 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 10 Oct 2012, 07:31 AM
Hi,

I have a combobox (with checkboxes inside it) that is inside a RadToolbar. I have an issue where the combobox always closes when a checkbox is checked. I've noticed that when the combobox is not inside a Toolbar then it will stay open to allow me to select multiple checkboxes. I would like to have the CB inside the toolbar so I'm looking for a fix. Is this a bug? Is there a fix?

<telerik:RadToolBar>
    <telerik:RadComboBox Name="rcbProjectTypes"
        Width="120" Margin="3,1,0,1"
        ItemsSource="{Binding Path=RequestTypesSelection}"
        SelectionChanged="rcbShouldNotChange_SelectionChanged">
        <telerik:RadComboBox.ItemTemplate>
            <DataTemplate>
                <CheckBox Content="{Binding Path=Content}" Tag="{Binding Path=Id}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay}"
                Checked="RequestTypesCheckBox_Checked" 
                Unchecked="RequestTypesCheckBox_Checked"/>
            </DataTemplate>
        </telerik:RadComboBox.ItemTemplate>
    </telerik:RadComboBox>
</telerik:RadToolBar>


Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 15 Oct 2012, 07:24 AM
Hello Peter,

 This is expected behavior of the RadToolBar because it keeps track of the focused elements inside itself.
So you can disable this behavior with the FocusManaged.IsFocusScope attached property:

<telerik:RadToolBar Width="300" Height="30" FocusManager.IsFocusScope="False" >
            <telerik:RadComboBox Name="combo" Width="120" Height="30" Margin="3,1,0,1" >
                <telerik:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding Path=Content}" Tag="{Binding Path=Id}"
                                IsChecked="{Binding Path=IsChecked, Mode=TwoWay}"
                                />
                    </DataTemplate>
                </telerik:RadComboBox.ItemTemplate>
            </telerik:RadComboBox>
        </telerik:RadToolBar>

This is also demonstrated in the attached project.

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Peter
Top achievements
Rank 1
answered on 15 Oct 2012, 10:36 PM
Ok, thankyou Petar.
Tags
ToolBar
Asked by
Peter
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Peter
Top achievements
Rank 1
Share this question
or