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

Programmatically enter EditMode on DoubleClick

3 Answers 280 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 20 Oct 2010, 11:56 AM
Hello,
I am trying to switch an RadTreeViewItem to EditMode on mouse double click.
When I do that, the content of the textbox is empty, isn't it a bug?
Thanks

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 22 Oct 2010, 03:51 PM
Hello Nicolas Bastin,

Thank you for your feedback . This appears to be a bug in the RadTreeView . I logged it in our PITS system where it will be published in the next  24  hours. I also updated your  Telerik  points.

However, there is a workaround. Supposing your RadTreeView is named radTreeView the following code should  work fine:

private void radTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
       {
           radTreeView.SelectedContainer.BeginEdit();
       }
 
Please  let me know if you need more info, I would be glad to assist you.

 

Sincerely yours,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Swapnil
Top achievements
Rank 1
answered on 04 Apr 2018, 11:52 AM

Hi,

We are facing issue in Editing RadTreeView node on mouse double click after upgrading the telerik version. It was working in previous version.

Code Behind

private void radTreeView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            RadTreeView trv = new RadTreeView();
            trv = (RadTreeView)e.Source;
            trv.SelectedContainer.BeginEdit();
        }

 

Xaml:

<telerik:RadTreeView x:Name="radTreeView" 
                             ItemsSource="{Binding}" 
                             ItemTemplate="{StaticResource itemTemplate}"
                             IsDragDropEnabled="True" IsEditable="True" MouseDoubleClick="radTreeView_MouseDoubleClick"
                             ItemEditTemplate="{DynamicResource EditShowTemplate}">
            <telerik:RadTreeView.Resources>
                <DataTemplate x:Key="EditShowTemplate">
                    <StackPanel Orientation = "Horizontal" >
                        <CheckBox Margin="0" IsChecked="{Binding CanDrag, Mode=TwoWay}" ToolTip="Is Network Owned"/>
                        <TextBox Margin="10"  FontSize="12" FontFamily="Arial"  Text="{Binding Header, Mode=TwoWay}"/>
                    </StackPanel>
                </DataTemplate>
            </telerik:RadTreeView.Resources>
        </telerik:RadTreeView>

 

Above functionality working using F2 key press. But when we use mouseDoubleClick event it fire the event but not not stay in Edit mode.

 

However, If we use "   <StackPanel Orientation = "Vertical" >" for Edit DataTemplate it works, But we want orientation as "vertical" as per design.

 

0
Martin Ivanov
Telerik team
answered on 05 Apr 2018, 06:52 AM
Hello Swapnil,

I tested your code but I wasn't able reproduce the issue. I already replied to your post in the other forum. Can you check it out? 

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeView
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Swapnil
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or