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

RibbonTab double-click event

2 Answers 142 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Nick Wasko
Top achievements
Rank 1
Nick Wasko asked on 18 Aug 2009, 06:42 PM
I remember seeing that a RadButton no longer fires a double-click event and instead fires two Click events.

I have code that used to run in the double-click event handler for a RibbonTab, but now that code no longer runs with version 2009.2.9.729.  Does the RibbonTab also no longer fire a double-click event?  If not, do you have any suggestions for simulating a double-click, as I have separate code for the (single) click event handler.

Thanks,
Nicholas Wasko

2 Answers, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 19 Aug 2009, 07:47 AM
Hello Nick,

Thanks for contacting us and for reporting this issue.

Indeed, we have removed the DoubleClick logic from RadButtonItem in our latest release since the double click event for a button is not conceptually right. Since the RibbonTab inherits from RadButtonItem this event will not work for it as well. We have put this in our Breaking Changes list for Q2 2009.

I have prepared a quick workaround for you though. Take a look at the following code snippet:

public MyForm() 
     InitializeComponent(); 
     this.radRibbonBar1.DoubleClick += new EventHandler(radRibbonBar1_DoubleClick); 
 
void radRibbonBar1_DoubleClick(object sender, EventArgs e) 
     Point pointInRibbon = this.radRibbonBar1.PointToClient(Control.MousePosition); 
     RibbonTab tabToDoubleClick = this.ribbonTab1; 
     if (this.ribbonTab1.ControlBoundingRectangle.Contains(pointInRibbon)) 
     { 
          //Do some double click logic 
     } 

Basically, I use the DoubleClick event of the RadRibbonBar control. When I double click on the RadRibbonBar, this event fires. In its handler, I check whether the position of the mouse cursor is above my tab. If yes, I do the logic which is to be executed upon double click on a certain tab.

I hope this is helpful. Do not hesitate to write back if you need further assistance.

Kind regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Nick Wasko
Top achievements
Rank 1
answered on 14 Sep 2009, 05:37 PM
Thanks, that works for now!
Tags
RibbonBar
Asked by
Nick Wasko
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Nick Wasko
Top achievements
Rank 1
Share this question
or