RadGridView inside RadComboBox

5 posts, 0 answers
  1. Max
    Max avatar
    27 posts
    Member since:
    May 2013

    Posted 28 May 2013 Link to this post


    I have requirement to display multiple columns under ComboBox with title and it should be also allow to sort RadGridView items. To achieve these requirement I decide to place a RadGridView inside RadComboBox.

    I have almost achieved these requirement however there is only one issue. When I click on an item of RadGridView the RadComboBox is not closing down which is RadComboBox default behavior.

    I tried to set IsDropDownOpen property of RadComboBox when user selects an item but it still not working.

    To modify ControlTemplate of RadComboBox I referred to following blog.

    In my case I have place RadGridView inside NonEditableTemplate. I don't know it's correct or not but yes it is working except the aforementioned issue. PFA image which displays the result so far I able to achieve.

    Please help to resolve this issue.

  2. Max
    Max avatar
    27 posts
    Member since:
    May 2013

    Posted 29 May 2013 Link to this post

    Any comment/suggestions Telerik team?
  3. Max
    Max avatar
    27 posts
    Member since:
    May 2013

    Posted 31 May 2013 Link to this post


    I am able to achieve the requirement. However it still needs some improvement. I have bind IsOpen property of Popups inside RadComboBox ControlTemplate to IsDropDownOpen property of RadComboBox which has been set to false on SelectedItem change. And that's it when I click any item in ComboBox it will close the popup.

    1. In-case there are multiple ComboBoxes I have to create ControlTemplate for each since each ComboBox may have different ItemsSource, No. of columns, DisplayMembers and SelectedValues.
    2. When first time ComboBox display it don't have value selected eventhough it is there in ItemsSource of GridView. Once I select an item from Combo next time onward it displays the value.

    <telerik:RadGridView x:Name="RadGridView99"
        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
        ItemsSource="{TemplateBinding ItemsSource}"
        SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem}"
            <telerik:GridViewDataColumn Header="Code"
                DataMemberBinding="{Binding CurrencyISOCode}" />
            <telerik:GridViewDataColumn Header="Name"
                DataMemberBinding="{Binding CurrencyName}" />

    Any help will be highly appreciated.

  4. Siddle
    Siddle avatar
    1 posts
    Member since:
    Dec 2016

    Posted 29 Dec 2016 in reply to Max Link to this post

    Hello, How to know that RadGridView is loaded or user is ready to use combo box? When we trying to select item the  its not opening immdiatly, we want to show a message if RadGridView  is not loaded but how?
  5. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 29 Dec 2016 Link to this post


    Can you please shed some more light on your scenario? Is RadGridView hosted in the ComboBox's drop down? As for tracking when a control gets loaded, you can subscribe to the FrameworkElement.Loaded event.

    Ivan Ivanov
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top