Keep Combobox Open

3 posts, 1 answers
  1. Peter
    Peter avatar
    95 posts
    Member since:
    Mar 2009

    Posted 10 Oct 2012 Link to this post

    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. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Oct 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Peter
    Peter avatar
    95 posts
    Member since:
    Mar 2009

    Posted 15 Oct 2012 Link to this post

    Ok, thankyou Petar.
Back to Top