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

ComboBoxEditorSettings and Cell Edit Mode

3 Answers 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ludovic Gerbault
Top achievements
Rank 1
Ludovic Gerbault asked on 03 Sep 2009, 04:20 PM
Hello

I created a GridViewDataColumn set with a ComboBoxEditorSetting.

What I'd like to do is when my grid gets the focus, I want the first cell of the first row (wich is my ComboBox) to enter in edit mode and I want to set the IsDropDownOpen property to true.

I've managed the first part, but I'm getting stucked with the second one (I can't get the RadComboBox in the GridViewCell)

Here's what I've wrote from a piece of code in this forum

        private void FormGrille_GotFocus(object sender, RoutedEventArgs e) 
        { 
            FormGrille.GotFocus -=new RoutedEventHandler(FormGrille_GotFocus);             
            DataRecord record = (DataRecord)this.FormGrille.Records[0]; 
            var element = (GridViewRow)this.FormGrille.ItemsControl.ItemsGenerator.GenerateItemAtIndex(record.DataSourceIndex); 
            ((GridViewCell)element.Items[0]).IsInEditMode = true
        } 

3 Answers, 1 is accepted

Sort by
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 04 Sep 2009, 12:42 PM
Any ideas, anyone ?
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 07 Sep 2009, 10:12 AM
Please, I'm still stucked on this one.
0
Pavel Pavlov
Telerik team
answered on 07 Sep 2009, 02:33 PM
Hi Subileau Pascal,

This is quite a specific scenario and is unfortunately not supported by the internal logic of the ComboBoxColumn and the ComboBoxEditorSettings.

Indeed there is no way to get the ComboBox editor  as it loads on demand after the cell has entered edit mode. To serve such scenario , we have scheduled to add an EditorLoaded event to the RadGridView for our very next official version.

Meanwhile there is a kind of solution:

Since GridViewComboBoxColumn does not help much here , you may use  a templated GridViewColumn.

You may place a ComboBox within the cell template and manually bind it to data and respond to selection changes, update datasource etc.

Regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Ludovic Gerbault
Top achievements
Rank 1
Answers by
Ludovic Gerbault
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or