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

GridViewComboBoxColumn requires two clicks

2 Answers 303 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 16 Feb 2012, 12:39 AM
I have a RadGridView, inside which I have a GridViewComboboxColumn. It looks like this.
<telerikGrid:GridViewComboBoxColumn Header="Data Source"  ItemsSourceBinding ="{Binding Sources}" DataMemberBinding="{Binding SelectedSourceId}"  DisplayMemberPath="SourceName" SelectedValueMemberPath="sourceId" EditTriggers="CellClick"></telerikGrid:GridViewComboBoxColumn>



I seem to be facing this issue. I require two clicks for the drop down box to open. I have read from many different posts here, people have had similar problems, but most of them were WPF in which case I could write a listener for ValueChanged or SelectionChanged. But this is Silverlight and I havent found a property for ValueChaned on RadGridView or GridViewComboBoxColumn. Any ideas on how to have the drop down show upon on click of the Combobox column?

On a similar note, I see that the item that I select from the combo box does not get bound to the property in view model until I focus elsewhere on the grid. In other words, I double click the combobox, select an item from the drop down, at this moment I expect "SelectSourceId" to be bound with value that I selected, but it is not until I click elsewhere in the grid the value is bound.

Any ideas what is happening here? Any help would be greatly appreciated
(PS i realize that these two might be two separate issues, if it is I apologize for posting it under the same thread)

Thanks
K

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 16 Feb 2012, 07:55 AM
Hi,

 As to your first question, you can achieve editing the GridViewComboBoxColumn on a single click by setting the EditTriggers property of the column  to 'CellClick'. Then to open the ComboBox  you should set the OpenDropDownOnFocus property of the editor to 'True'.  

As to your second issue, this is the expected behaviour. Please define your own CellTemplate/ CellEditTemplate if you need a different behaviour.

Regards,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Karthik
Top achievements
Rank 1
answered on 01 Mar 2012, 01:16 AM
Sorry about the delayed reply, I got around the problem by using a DataTemplate and ComboBox inside it, instead of going for GridViewComboBoxColumn. For anyone who might be interested he is the sample

 <telerikGrid:GridViewDataColumn Header="Column Header Name"<telerikGrid:GridViewDataColumn.CellTemplate><DataTemplate> <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <ComboBox ItemsSource="{Binding ItemsSource}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"></ComboBox> </StackPanel> </DataTemplate><br></telerikGrid:GridViewDataColumn.CellTemplate></telerikGrid:GridViewDataColumn>


Thanks for the help

K
Tags
GridView
Asked by
Karthik
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Karthik
Top achievements
Rank 1
Share this question
or