how to call client event when i clicked on the ribbonbartab

7 posts, 0 answers
  1. Mr. Joo
    Mr. Joo avatar
    2 posts
    Member since:
    Feb 2011

    Posted 31 May 2011 Link to this post

    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.
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 03 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mr. Joo
    Mr. Joo avatar
    2 posts
    Member since:
    Feb 2011

    Posted 06 Jun 2011 Link to this post

    Great, thanks for your reply.
  5. Dan
    Dan avatar
    4 posts
    Member since:
    Jul 2011

    Posted 26 Jul 2011 Link to this post

    How do I fire an insert event or delete event in a radgrid from the same ribbon bar?
  6. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 27 Jul 2011 Link to this post

    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.

  7. Dan
    Dan avatar
    4 posts
    Member since:
    Jul 2011

    Posted 09 Aug 2011 Link to this post

    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.

  8. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 15 Aug 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017