GridViewComboBoxColumn requires two clicks

3 posts, 0 answers
  1. Karthik
    Karthik avatar
    15 posts
    Member since:
    Feb 2012

    Posted 15 Feb 2012 Link to this post

    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 16 Feb 2012 Link to this post

    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 >>
  3. Karthik
    Karthik avatar
    15 posts
    Member since:
    Feb 2012

    Posted 29 Feb 2012 Link to this post

    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
Back to Top