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

How to disalbe dragover capture on RadTreeListView columns header

3 Answers 61 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Jiri
Top achievements
Rank 1
Jiri asked on 10 Jan 2017, 10:35 AM

How can I disable dragover capture on RadTreeListView columns headers in case like example below? I would like to not have impossible drop visual in case of dragging over column headers.

Example:

<telerik:RadTreeListView x:Name="radTreeListView"AutoGenerateColumns="False">
  <telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}"/>       
  </telerik:RadTreeListView.ChildTableDefinitions>
  <telerik:RadTreeListView.Columns>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"Header="Name" />
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Count}"Header="Count"  />
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

3 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 12 Jan 2017, 03:46 PM
Hello Jiri,

Please try the following approach:

InitializeComponent();
           this.RadTreeListView1.AddHandler(GridViewHeaderCell.DragOverEvent, new DragEventHandler(OnGridViewHeaderCellDrop), true);
       }
  
 private void OnGridViewHeaderCellDrop(object sender, DragEventArgs e)
       {
           e.Effects = DragDropEffects.All;
       }


Regards,
Stefan Nenchev
Telerik by Progress
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
Jiri
Top achievements
Rank 1
answered on 13 Jan 2017, 05:45 PM

I have already register handler for DragOverEvent. Without that would be impossible to drop items off columns header. So second registration is not possible.

Beside this problem I am getting ArgumentException on AddHandler call (Handler type is mismatched).

0
Stefan Nenchev
Telerik team
answered on 18 Jan 2017, 09:16 AM
Hi Jiri,

You can try setting .Effects in the already registered event handler. 

Regards,
Stefan Nenchev
Telerik by Progress
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 you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeListView
Asked by
Jiri
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Jiri
Top achievements
Rank 1
Share this question
or