WinForm: Drag & Drop is blocked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SaGeek
    New Member
    • Nov 2014
    • 1

    WinForm: Drag & Drop is blocked

    I have a Winform with a DevExpress.Extr aGrid and a User Control of .Net. that contains a Grid as well.
    When I try to Drag & Drop from the Grid onto the UserControl, once the mouse is on the UserControl I see a Blocked Icon (black circle with line over it) like it's disabled or something.
    I made sure the 'AllowDrop' property is true in both grids. It seems I can't in any case catch the event of MouseUp once I reached the UserControl and start seeing the blocked Icon.
    Any idea why? Will appreciate any help!
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    There should be a DragEnter Event that you can handle and specify the "Effect" that is used.

    This way you can check the type of the thing being dragged onto the page and if it is allowed you can set the DragDropEffects to All, or if it is not allowed you can set it to None (which is what you are seeing right now)

    -Frinny

    Comment

    • Kara Hewett
      New Member
      • Apr 2014
      • 27

      #3
      You can handle the PreviewMouseUp event to catch the moment when the user clicks on a column header:

      [C#]
      Code:
      private void view_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
          TableViewHitInfo info = view.CalcHitInfo((DependencyObject)e.OriginalSource);
          if (info.InColumnHeader) {
              MessageBox.Show(info.Column.FieldName);
          }
      }
      1
      solution
      MouseUp event not firing.
      Tags:
      .NET, WPF, DXGrid for WPF 0
      Victoryking
      3 years ago MouseUp event is not firing. we need this for sorting. I read from other post that this is by design and we should use GridControl.Cus tomColumnSort Event. Our Application architecture is different. A legacy delphi component does sorting of the records. so, I need a proper event to call the sorting methods and re-bind the new data? Also, I need to AllowMove for columns.


      any comments?
      Show all comments
      Dmitry (DevExpress Support)
      3 years ago >>Also, I need to AllowMove for columns.
      I'm afraid that your requirements are not clear to me. We kindly ask you to create a new ticket regarding this second problem in order not to mix discussions devoted to different subjects in one ticket and avoid misunderstandin g. Please describe the problem that you have encountered and the task you wish to implement in greater detail and we will do our best to find an appropriate solution.
      Show all comments
      Leave a Comment You must log in or register to leave comments 1 Solution0
      Dmitry (DevExpress Support)
      3 years ago You can handle the PreviewMouseUp event to catch the moment when the user clicks on a column header:
      [C#]Open in popup window
      Code:
      private void view_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
          TableViewHitInfo info = view.CalcHitInfo((DependencyObject)e.OriginalSource);
          if (info.InColumnHeader) {
              MessageBox.Show(info.Column.FieldName);
          }
      }
      This event is raised before the MouseUp and can be handled at the TableView's level.
      Last edited by Frinavale; Nov 26 '14, 04:31 PM. Reason: Added code tags.

      Comment

      Working...