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

Multiple clicks to get focus of a ComboBox in TreeListView

6 Answers 29 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 09 Mar 2011, 11:22 AM
Hello,

I'm using a RadTreeListView with a GridViewComboBoxColumn. I need at least three clicks to open the dropdown list.
I assume first is to focus the cell second to get the edit mode third to open the list. Is there a way to do it with only one click?
Here is the XAML code of my RadTreeListView:

            <t:RadTreeListView x:Name="TreeListView"
                                 AutoGenerateColumns="False"
                                 ItemsSource="{Binding Zeile.Liste}"
                                 SelectedItem="{Binding Current, Mode=TwoWay}"
                                 CanUserReorderColumns="True"
                                 CanUserFreezeColumns="True"
                                 EnableColumnVirtualization="True"
                                 EnableRowVirtualization="True" >

                <t:RadTreeListView.ChildTableDefinitions>
                    <t:TreeListViewTableDefinition ItemsSource="{Binding Liste}"/>
                </t:RadTreeListView.ChildTableDefinitions>
                
                <t:RadTreeListView.HierarchyChildTemplate>
                    <DataTemplate>
                        <t:RadTreeListView ItemsSource="{Binding Liste}"/>
                    </DataTemplate>
                </t:RadTreeListView.HierarchyChildTemplate>

                <t:RadTreeListView.Columns>
                    <t:GridViewComboBoxColumn Header="Bezeichnung"
                                                    DataMemberBinding="{Binding AuswahlListeId}"
                                                    ItemsSourceBinding="{Binding AuswahlListe}"
                                                    SelectedValueMemberPath="Id"
                                                    DisplayMemberPath="Bezeichnung">
                    
                        <t:GridViewComboBoxColumn.CellEditTemplate>
                            <DataTemplate>
                                <t1:RadComboBox ItemsSource="{Binding VerfuegbarListe}"
                                                      SelectedValue="{Binding AuswahlListeId, Mode=TwoWay}"
                                                      SelectedValuePath="Id"
                                                      DisplayMemberPath="Bezeichnung" />
                            </DataTemplate>
                        </t:GridViewComboBoxColumn.CellEditTemplate>
                    
                    </t:GridViewComboBoxColumn>

                    <t:GridViewDataColumn DataMemberBinding="{Binding Menge}"
                                                IsReadOnly="True"
                                                Header="Menge" />
                </t:RadTreeListView.Columns>
            </t:RadTreeListView>

Regards,

Andreas

6 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 09 Mar 2011, 01:01 PM
Hi Andreas,

You may take a look at this forum thread for a reference.
 

All the best,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Andreas
Top achievements
Rank 1
answered on 10 Mar 2011, 10:07 AM
Hi,

thank you for your help, this is working now. But what do I have to do to switch into the view mode after I have selected one Item from the ComboBox. Right now I have to leave the cell in order to end the edit mode.

Regards,

Andreas
0
Accepted
Maya
Telerik team
answered on 10 Mar 2011, 12:47 PM
Hello Andreas,

In this case you will have to handle the SelectionChanged event of the RadComboBox and commit the changes once a value is selected from it:

this.RadGridView1.AddHandler(RadComboBox.SelectionChangedEvent, new Telerik.Windows.Controls.SelectionChangedEventHandler(comboSelectionChanged), true);
 
 
private void comboSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
{
    if (e.RemovedItems.Count != 0)
    {
        //this ensures a selection from the drop down is performed.
        this.RadGridView1.CommitEdit();
    }
}  

 

Best wishes,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Andreas
Top achievements
Rank 1
answered on 10 Mar 2011, 02:03 PM
Hi Maya,

intelli sense ist complaining about the first line

TreeListView.AddHandler(RadComboBox.SelectionChangedEvent, new SelectionChangedEventHandler(comboSelectionChanged), true);

saying that Argument type 'Telerik.Windows.RoutedEvent is not assignable to parameter type System.Windows.RoutedEvent'.

Andreas

0
Accepted
Maya
Telerik team
answered on 10 Mar 2011, 02:13 PM
Hi Andreas,

May you try to add reference to the Telerik.Windows assembly (using Telerik.Windows;) ?
 

All the best,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Andreas
Top achievements
Rank 1
answered on 10 Mar 2011, 02:25 PM
It's working :)

Thanks a lot,

Andreas
Tags
TreeListView
Asked by
Andreas
Top achievements
Rank 1
Answers by
Maya
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or