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

Disabling/Overwriting Context Menu at Floating Dock Panel

2 Answers 148 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Haroon
Top achievements
Rank 1
Haroon asked on 21 Jan 2008, 06:20 AM

Hi,

I Hope all Telerik team member would be fine.

I am working with Docking Manager and faced an issue that on floating docking Panel I am unable to disable context Menu on the Caption. Then I found a thread regarding this issue i.e. http://www.telerik.com/community/forums/thread/b311D-htaac.aspx, and now I hope as Q3 is release there would be some how that I want change it  and can hide it. Please do guide in this matter.

 P.S. It cause major problems for me if the use 'Hides' or change it into 'Tab Document' specailly.

Regards,

Haroon.

2 Answers, 1 is accepted

Sort by
0
kdev
Top achievements
Rank 1
answered on 22 Jan 2008, 10:38 AM
Hi,

I also have the same problem as Haroon,
To overwrite the DockPanel menu, Telerik proposed me to do like that 
(this.dockingManager1.PrimarySite as DockSite).PostLayout += new EventHandler(Form1_PostLayout);  
 
 void Form1_PostLayout(object sender, EventArgs e)  
        {  
             DockPanel panel = (sender as Telerik.WinControls.Docking.DockSite).Active as DockPanel;  
             
             if (panel != null)  
             {  
                 ChangeDropDownMenu(panel);  
             }  
             
        }  
 
      public void ChangeDropDownMenu(DockPanel dockPanel)  
     {  
         if (dockPanel.DefaultPresenter != null && dockPanel.DefaultPresenter is DockPresenterControl)  
         {  
             RadItem dockPresenterElement = ((DockPresenterControl)dockPanel.DefaultPresenter).DockPresenterElement;  
             ClassSelector selector = new ClassSelector("DockPresenterCaptionDropDown");  
             RadDropDownButtonElement dropDownButton = selector.GetSelectedElements(dockPresenterElement)[0] as RadDropDownButtonElement;  
             this.AddMenuItems(dropDownButton, dockPanel);  
         }  
     }  
 

But as Haroon notice, this don't work for a floating or an Autohide Panel  :S 

please Telerik team, can you propose as an alternative solution
thanks you for your great work
kort
0
Julian Benkov
Telerik team
answered on 23 Jan 2008, 10:30 AM
Hi Haroon,

Sorry for the inconvenience, but we haven't found an appropriate workaround for this scenario yet.

In current release of the Docking component there is no public API for accessing the AutoHide presenter and override mechanism for right click. The new API will be provided for Q3 SP1 release planned for second week of February.

If you have additional questions, please contact us.

All the best,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
Haroon
Top achievements
Rank 1
Answers by
kdev
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or