RadToolBar button issue

1 posts, 0 answers
  1. chandan singh
    chandan singh avatar
    10 posts
    Member since:
    Aug 2009

    Posted 03 Jun 2012 Link to this post

    Hi Team,
    I am facing issue with RadToolBar button. I am trying to open ModalPopup extender on specific RadToolBar button but unable to do it.How I can do It. I want to handle it on JavaScript. Please find my code.
    PopUp open when i click on any place on RadToolBar.Please provide me solution. 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
     
    namespace GridPopUpTest
    {
        public partial class ParentForm : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
     
            }
     
           
        }
    }
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ParentForm.aspx.cs" Inherits="GridPopUpTest.ParentForm" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
     
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
        <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
         
    </head>
    <body>
     
     
        <form id="form1" runat="server">
          <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
         <script type="text/javascript">
     
     
             function OnClientButtonClicking(sender, eventArgs) {
     
                 var button = eventArgs.get_item();
                 alert(button.get_text());
                 if (eventArgs.get_item().get_value() == "NoPopUp") {
                     //eventArgs.set_cancel(true);
                     HideModalPopup();
                 }
                 if (eventArgs.get_item().get_value() == "PopUp") {
                     //eventArgs.set_cancel(true);
                     ShowModalPopup();
                 }
             }
             function ShowModalPopup() {
                 $find("ModalBehaviour1").show();
             }
             function HideModalPopup() {
                 $find("ModalBehaviour1").hide();
             }
             function JobsRowSelected(sender, args) {
                 var id = args.get_id();
                 var inputCheckBox = $get(id).getElementsByTagName("input")[0];
                 if (!inputCheckBox) {
                     args.set_cancel(true);
                 }
                 if (inputCheckBox.checked == true) {
                     inputCheckBox.checked = false;
                 }
                 else {
                     inputCheckBox.checked = true;
                 }
             }
          
         </script>
        
        <div>
         
     
     
            <telerik:RadToolBar ID="RadToolBar1" runat="server"   OnClientButtonClicking="OnClientButtonClicking">
            <Items>
                <telerik:RadToolBarButton Text="NoPopUp" Value="NoPopUp" ></telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="OpenpopUp"  Value="PopUp"></telerik:RadToolBarButton>
            </Items>
            </telerik:RadToolBar>
             
             <asp:Panel runat="server" ID="pnldtls">
                <table>
                    <tr>
                        <td>Name</td>
                        <td><asp:TextBox ID="txtName" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="btnOk" Text="Ok" runat="server" /></td>
                        <td><asp:Button ID="btnCancel" Text="Cancel" runat="server" /></td>
                    </tr>
                </table>
                 
             </asp:Panel>
              <cc1:modalpopupextender id="ModalPopupExtender1" runat="server" BehaviorID="ModalBehaviour1"
        cancelcontrolid="btnCancel" okcontrolid="btnOk" BackgroundCssClass="ModalPopupBG"
        targetcontrolid="RadToolBar1" popupcontrolid="pnldtls" DropShadow="false">
    </cc1:modalpopupextender>
        </div>
        </form>
    </body>
    </html>
Back to Top