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

GridViewComboBoxColumn and selected value

2 Answers 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mrn
Top achievements
Rank 1
Mrn asked on 10 Nov 2011, 06:24 PM
Hello,

Is there any way to get the selected item/value of the combo box of the GridViewComboBoxColumn? Or an event triggered when selection changes, as the regular RadComboBox? I'd like to perform some operations depending on the selection made by the user at the moment she changes the selection (what I'd implement in SelectionChanged event of RadComboBox)...

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 10 Nov 2011, 06:38 PM
Hello,

Generally, you can get the selected item from the value of the underlying property of your business object. As it is in the case illustrated in our online documentation, you can find the selected item (Country) from the CountryID property of Person object.
Still, you can handle SelectionChanged event of the editing element (RadComboBox) of GridViewComboBoxColumn as follows:

this.AddHandler(RadComboBox.SelectionChangedEvent, new Telerik.Windows.Controls.SelectionChangedEventHandler(OnSelectionChanged));
           
   
        private void OnSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (e.RemovedItems.Count > 0)
            {
                //Here you can place your logic for handling the case when an item is selected from the combo box.
            }
        }


Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mrn
Top achievements
Rank 1
answered on 11 Nov 2011, 11:00 AM
Ok, thanks
Tags
GridView
Asked by
Mrn
Top achievements
Rank 1
Answers by
Maya
Telerik team
Mrn
Top achievements
Rank 1
Share this question
or