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

cancel ontabclick

4 Answers 169 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 28 Jun 2011, 02:48 PM
I have a RadTabStrip with an ontabclick event.  How can I cancel the event after a tab is clicked so that the user stays on the current tab?

I am using version 2010.3.1215.40

Thanks.

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 29 Jun 2011, 01:25 PM
Hello Craig,

I don't know if you're doing something on the server-side event to determine if the tab should remain on the current one, but on the client-side you can handle the OnClientTabSelecting and cancel the event so it remains on the current tab.

Help Topic On Client-Side Event: http://www.telerik.com/help/aspnet-ajax/tabstrip-onclienttabselecting.html

I hope that helps.
0
Craig Wallace
Top achievements
Rank 1
answered on 29 Jun 2011, 01:55 PM
Hi Cori,

OnTabClick is server-side so the cancellation needs to be server-side.  Can I only set the tab to what it already was and not cancel the event?

Craig
0
Accepted
Veronica
Telerik team
answered on 30 Jun 2011, 09:47 AM
Hi Craig,

You can use a hidden field to store the previous state on OnClientTabSelecting client-side event and perform the needed checks in the OnTabClick server-side event. That way if the condition in the OnTabClick server-side event is not satisfied - you can access the value of the hidden field and return to what it already was.

Regards,
Veronica Milcheva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Daniel
Top achievements
Rank 1
answered on 04 Mar 2014, 11:05 AM
Hello Mr Craig Wallace,

I have submitted the same question with my workaround:

http://www.telerik.com/forums/radtabstrip-(elegant-way-to)-prevent-change-tab-on-server-side

Today Mr Shino notice me than my question is dup. I don't delete it because it has workaround code.

regards.
Tags
TabStrip
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Craig Wallace
Top achievements
Rank 1
Veronica
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or