How to disalbe dragover capture on RadTreeListView columns header

4 posts, 0 answers
  1. Jiri
    Jiri avatar
    9 posts
    Member since:
    Nov 2016

    Posted 10 Jan Link to this post

    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>
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    501 posts

    Posted 12 Jan Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Jiri
    Jiri avatar
    9 posts
    Member since:
    Nov 2016

    Posted 13 Jan in reply to Stefan Nenchev Link to this post

    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).

  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    501 posts

    Posted 18 Jan Link to this post

    Hi Jiri,

    You can try setting the e.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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top