Multi Column CombBox

2 posts, 0 answers
  1. Kamran
    Kamran avatar
    16 posts
    Member since:
    Nov 2011

    Posted 27 Nov 2011 Link to this post

    Hi Team,
    I want a multi column combobox, for this i create a combobox and define gridview as RadcomboboxItem. It works fine, but I am unable to filter gridview. I want a multicolumn combobox, which can filter columns. I RadGridView1_SelectionChanged event to set selected value.
     Your Quick response will be highly appreciated.

    Following is Xmal Code:

    <telerik:RadComboBox Name="rcbNew" Grid.Row="0"

                              IsEditable="True" Height="25" Width="200">

                <telerik:RadComboBox.Items>

                    <telerik:RadComboBoxItem>

                        <telerik:RadComboBoxItem.Template>

                            <ControlTemplate>

                                <my1:RadGridView x:Name="RadGridView1" ShowGroupPanel="False" CanUserFreezeColumns="False"

                                                 RowIndicatorVisibility="Collapsed" IsReadOnly="True"

                                                 IsFilteringAllowed="False" ItemsSource="{Binding .}"

                                                 Width="200" Height="150" SelectionChanged="RadGridView1_SelectionChanged" >

                                </my1:RadGridView>

                            </ControlTemplate>

                        </telerik:RadComboBoxItem.Template>

                    </telerik:RadComboBoxItem>

                </telerik:RadComboBox.Items>

            </telerik:RadComboBox>




    Here follwoing code:

         

    DependencyProperty currentSelectedValue = DependencyProperty.Register("rcbNewSelectedValue", typeof(Int32), typeof(Int32));
            // Constructor
    public GridinDropDown()

            {

                InitializeComponent();

                IList<Company> MyObject;

     

                MyObject = new List<Company>()

                {

                    new Company { Id=1, Name="Description1" },

                    new Company { Id=2, Name="Description2" },

                    new Company { Id=3, Name="Description3" },

                    new Company { Id=4, Name="Description4" }

                };

     

                this.DataContext = MyObject;

            }

    private void RadGridView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)

            {

                rcbNew.Text = ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Name;

                rcbNew.SetValue(currentSelectedValue, ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Id);// = ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Id;

                rcbNew.IsDropDownOpen = false;

            }


          

     

      

  2. Azar
    Azar avatar
    2 posts
    Member since:
    Dec 2013

    Posted 02 Dec 2013 Link to this post

    It is working for me perfectly.
    thanks
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top