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

Multi Column CombBox

1 Answer 124 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
Kamran asked on 27 Nov 2011, 01:00 PM
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;

        }


      

 

  

1 Answer, 1 is accepted

Sort by
0
Azar
Top achievements
Rank 1
answered on 02 Dec 2013, 11:33 AM
It is working for me perfectly.
thanks
Tags
ComboBox
Asked by
Kamran
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Azar
Top achievements
Rank 1
Share this question
or