11 Answers, 1 is accepted
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
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
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.
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
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
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
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.
Nikolay
the Telerik team
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
this is solution
GridViewRowInfo info = this.rgvPerson.CurrentRow;
if (info != null && e.RowIndex >= 0)
{
}
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