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

how to call client event when i clicked on the ribbonbartab

6 Answers 227 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Mr. Joo
Top achievements
Rank 1
Mr. Joo asked on 31 May 2011, 05:48 AM
hello
i have questions.
how to call client event (such as javascript function call) when i clicked on the ribbonbartab.
please let me know soon.
thank.

6 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 03 Jun 2011, 05:17 PM
Hi Mr. Joo,

You can attach client-side events to the internal RadTabStrip in this way:
protected void Page_Load(object sender, EventArgs e)
    {
        var tabStrip = RadRibbonBar1.FindControl(RadRibbonBar1.ID + "_TabStrip") as RadTabStrip;
 
        tabStrip.OnClientTabSelected = "onTabSelected";
    }

I hope this helps.

Regards,
Simon
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
Mr. Joo
Top achievements
Rank 1
answered on 07 Jun 2011, 01:52 AM
Great, thanks for your reply.
0
Dan
Top achievements
Rank 1
answered on 26 Jul 2011, 11:07 PM
How do I fire an insert event or delete event in a radgrid from the same ribbon bar?
0
Kate
Telerik team
answered on 27 Jul 2011, 08:37 AM
Hi Dan,

You could use the OnClientButtonClicking client-side event where you can find a particular button in the RadRibbonBar control and then implement the logic to add new row to the grid (you can refer to this help article on how to add new record using client-side). Here is an example of how you can start by finding a button in the RadRibbonBar control:
<script type="text/javascript">
        function OnClientButtonClicking(sender, args) {
        var button = args.get_button();
 
            if (button.get_text() == "New") {
                //imlement logic to add new record
                //for example the following code disables a button
                button.set_enabled(false);
            }
            else
            //some logic in case another button is clicked
            //for example the following code enables a button
                button.set_enabled(true);
        }
    </script>

markup:
<telerik:RadRibbonBar ID="RadRibbonBar1" runat="server" Height="105px" SelectedTabIndex="0"
            OnClientButtonClicking="OnClientButtonClicking">
            <telerik:RibbonBarTab>
                <telerik:RibbonBarGroup Text="Group1" EnableLauncher="false">
                    <Items>
                        <telerik:RibbonBarButton Size="Medium" Text="New" Value="NewCompany" ToolTip="New Company" />
                        <telerik:RibbonBarButton Size="Medium" Text="Edit" Value="EditCompany" ToolTip="Edit Company" />
                    </Items>
                </telerik:RibbonBarGroup>
            </telerik:RibbonBarTab>
        </telerik:RadRibbonBar>

Kind regards,
Kate
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
Dan
Top achievements
Rank 1
answered on 09 Aug 2011, 05:18 PM
Kate,


I want to click on a button which navigates to an ASP.NET page, and open it in a separate frame (frame name f2).

How do I click on a button in frame f1, pass the URI to javascript and open that URI in frame F2?

Thanks.

0
Kate
Telerik team
answered on 15 Aug 2011, 12:32 PM
Hello Dan,

I believe that this demo would give you a clear idea of how to get the desired behaviour by using RadWindow control.

Greetings,
Kate
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.

Tags
RibbonBar
Asked by
Mr. Joo
Top achievements
Rank 1
Answers by
Simon
Telerik team
Mr. Joo
Top achievements
Rank 1
Dan
Top achievements
Rank 1
Kate
Telerik team
Share this question
or