Best way to suppress UserControl point when dragging HostWindow

3 posts, 1 answers
  1. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 09 Aug 2017 Link to this post

    I'm using version 2017.2.613.40 of RadDock.

    I'm using RadDock to host custom user controls by calling:

    radDock.DockControl(_HostedControl, DefaultDockPosition, DockType.Document);


    This creates a HostWindow.  It works great, however some of my user controls have somewhat expensive paint events.  For example, one is a chart which could have tens of thousands of data points and it can take a second or two to repaint the control.  Obviously, I'd like for this paint to be instant, but it's not.  It's what I'm stuck with for now.

    My issue is when I try to rearrange DockWindows by dragging them to a different position in the RadDock and docking them there.  The dragging triggers repaints in the user control.  And the user control tries to repaint while it's being dragged.  This ends up stalling everything for a couple seconds several times during the drag.  This makes it not just annoying, but almost impossible to move DockWindows around which is one of the main reasons, of course, to use a RadDock in the first place.

    My question is this:  what are the best RadDock or DockWindow events to subscribe to in order to disable my control when the drag starts and then to re-enable it after it gets re-docked at a new location in the RadDock.

    Since these are custom controls, I have the ability to turn off painting or hide the control completely, I just need the right hooks to be able to do this at the right times.




  2. Answer
    Dimitar avatar
    2951 posts

    Posted 10 Aug 2017 Link to this post

    Hi Steve,

    One way to solve this is to set the DragDropMode (see below). You can use the DragDropService events as well:
    public RadForm1()
        this.radDock1.DragDropMode = DragDropMode.Preview;
        DragDropService service = this.radDock1.GetService<DragDropService>();
        service.Started += Service_Started;
        service.Stopped += Service_Stopped;
    private void Service_Stopped(object sender, EventArgs e)
        radChartView1.Visible = true;
    private void Service_Started(object sender, EventArgs e)
        radChartView1.Visible = false;

    I hope this will be useful. Let me know if you have additional questions.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 11 Aug 2017 in reply to Dimitar Link to this post

    Thanks.  DragDropMode.Preview is a big help.


Back to Top