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

How to disable ToolWindow floating after double click header

11 Answers 340 Views
Dock
This is a migrated thread and some comments may be shown as answers.
kj
Top achievements
Rank 1
kj asked on 25 Aug 2010, 02:53 PM
Hi,

If I double click the header of Toolwindow, it will become floating. May this function be closed? Thanks.

11 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 25 Aug 2010, 04:14 PM
Hi, 

If you mean you only want to be able to resize, autohide and pin, then this should do it for you. Add to FormLoad (for example)

Me.ToolWindow1.AllowedDockState = Telerik.WinControls.UI.Docking.AllowedDockState.All And Not Telerik.WinControls.UI.Docking.AllowedDockState.Floating
0
Nikolay
Telerik team
answered on 30 Aug 2010, 02:37 PM
Hello guys,

Richard, thank you for your assistance.

KJ, please let us know if this solution is suitable for your scenario or if you are after different behavior.

Regards,
Nikolay
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
kj
Top achievements
Rank 1
answered on 01 Sep 2010, 02:08 PM
Thanks for your reply, Richard. But it is not my problem.

Please refer to following online help, I want to cancel the function of
mouse support.

http://www.telerik.com/help/winforms/dock_usabilitykeyboardsupport.html

Mouse support:
Double click: Double-clicking the title bar of a ToolWindow un-docks the panel so that it
floats. Double-clicking the title bar of a floating ToolWindow docks the ToolWindow.

Besides, if I right-click on the header of  ToolWIndow, the contextmenu with option for docking or floatong will appear, can this be close? Thanks for your reply.
0
Richard Slade
Top achievements
Rank 2
answered on 02 Sep 2010, 09:37 AM
Tried to upload a sample project for you but not allowed here. 
This could should help


Private Sub Form_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
 
    ' Tool window properties
    Me.ToolWindow1.DocumentButtons = Telerik.WinControls.UI.Docking.DocumentStripButtons.None
    Me.ToolWindow1.ToolCaptionButtons = Telerik.WinControls.UI.Docking.ToolStripCaptionButtons.AutoHide
 
    ' Document window properties
    Me.DocumentWindow1.DocumentButtons = Telerik.WinControls.UI.Docking.DocumentStripButtons.None
    Me.DocumentWindow1.ToolCaptionButtons = Telerik.WinControls.UI.Docking.ToolStripCaptionButtons.None
 
    ' Tell the Tool Window it may not float or be a tabbed document
    Me.ToolWindow1.AllowedDockState = Telerik.WinControls.UI.Docking.AllowedDockState.All And _
        Not Telerik.WinControls.UI.Docking.AllowedDockState.Floating And _
        Not Telerik.WinControls.UI.Docking.AllowedDockState.TabbedDocument
End Sub


Richard
0
Nikolay
Telerik team
answered on 13 Sep 2010, 09:30 AM
Hello guys

KJ, if I understand your requrement correctly, you want to remove only the double-click support, but you still want to be able to float a window by a mouse drag operation. If this is the case, please refer to the code snippet below. Basically, you need to handle the TransactionCommitting event and check which is the reason for the transaction. In addition, you can prevent the context menu from appearing by handling the ContextMenuDisplaying event of the ContextMenuService:
    public Form1()
    {
        InitializeComponent();
  
        ContextMenuService menuService = this.radDock1.GetService<ContextMenuService>();
        menuService.ContextMenuDisplaying += menuService_ContextMenuDisplaying;
  
        this.radDock1.TransactionCommitting += new RadDockTransactionCancelEventHandler(radDock1_TransactionCommitting);
    }
  
    void radDock1_TransactionCommitting(object sender, RadDockTransactionCancelEventArgs e)
    {
        RedockTransaction transaction = e.Transaction as RedockTransaction;
        if (transaction != null)
        {
            if (transaction.Reason == RedockTransactionReason.ToolTabStripCaptionDoubleClick 
                || transaction.Reason == RedockTransactionReason.FloatingWindowCaptionDoubleClick)
            {
                e.Cancel = true;
            }
        }
    }
  
    private void menuService_ContextMenuDisplaying(object sender, ContextMenuDisplayingEventArgs e)
    {
        if (e.DockWindow is ToolWindow)
        {
            e.Cancel = true;
        }            
    
}

I hope this helps.

Best Regards,
Nikolay
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
Abhishek
Top achievements
Rank 1
answered on 06 May 2011, 06:11 AM
On a related note, I would like to mention that there is an issue with floating toolwindows not returning to their previous state on double-click of their headers if the previous state was a "tabbedDocument".

Steps to reproduce :

1. Dock Fill a toolwindow to have a tabbed document.
2. Right-click the tabbed document and select Floating option (I would rather prefer if this also could be achieved by double-clicking on the header of tabbeddocument).
3. Now you have a floating toolwindow, double-click on its header and it should go back to its previous state which was a "tabbedDocument" (or DockFill), but this doesn't happen and the toolwindow gets left docked on the form.

Please help with this.

Thanks
Abhishek Dudeja
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 10 May 2011, 03:23 PM
I have the exact same problem. A double-click on a floating window always default to a LeftDock.
0
Nikolay
Telerik team
answered on 11 May 2011, 03:01 PM
Hello guys,

The behavior that you experience is the designed behavior of RadDock - floating windows can only become docked ToolWindows by the double click operation. I have added your requirement as a feature request in our PITS.

Despite the fact that there is no straightforward solution, I think that you can achieve the desired behavior by handling two events: DockStateChanging and TransactionCommitting. I am attaching a sample project that demonstrates the approach.

I hope this helps.

All the best,
Nikolay
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Denius
Top achievements
Rank 1
answered on 15 Nov 2017, 10:29 AM

Hello everyone, when I double-click on the header, it opens up my form, I do not want it.

Yes, i have event CellDoubleClik on the grid, but I 2x click on the header , and open my form (stupid)

How to fix it?

 

Tnx a lot 

0
Denius
Top achievements
Rank 1
answered on 15 Nov 2017, 10:59 AM

this is solution 

 GridViewRowInfo info = this.rgvPerson.CurrentRow;
            if (info != null && e.RowIndex >= 0)

{

}

0
Hristo
Telerik team
answered on 15 Nov 2017, 12:01 PM
Hi Denius,

This thread is discussing the RadDock control. I am posting below the link to the other forum thread with your question: https://www.telerik.com/forums/rad-grid-celldoubleclick-event.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Dock
Asked by
kj
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Nikolay
Telerik team
kj
Top achievements
Rank 1
Abhishek
Top achievements
Rank 1
Per D. H. Pasgaard
Top achievements
Rank 1
Denius
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or