RadToolbarButton (OnClientButtonClicked)

5 posts, 0 answers
  1. Laz
    Laz avatar
    31 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2009 Link to this post

    Hi to all,

    i have a RadToolbar and a RadGrid.

    By clicking RadToolbarButton (OnClientButtonClicked), i want to go throw RadGrid - Items an check if a RadCombobox have a value or not.

    It seems that Javascript is not detected or another problem is located.

    Can anybody help me ...?

    The Error message is a JavaScript Error "OnClientButtonClicking" is undefine

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
     
        <script type="text/javascript">     
            function OnClientButtonClicking(sender, args) {  
                var comandName = args.get_item().get_commandName();  
                if (comandName == "SaveSks") {  
                    alert('Check RadComboBoxes');  
                    return false;  
                }  
            }  
        </script> 
     
    </telerik:RadCodeBlock> 
     
    <table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed">  
        <tr> 
            <td> 
                <telerik:RadToolBar Width="100%"   
                                    style="display: block; float: none"   
                                    ID="RadToolBar1"   
                                    Runat="server"   
                                    OnClientButtonClicking="OnClientButtonClicking" 
                                    onbuttonclick="RadToolBar1_ButtonClick">  
                      
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                      
                    <Items> 
                        <telerik:RadToolBarButton Value="Back" 
                                                  ImageUrl="~/Arrow Left.png"   
                                                  runat="server" Text="Back">  
                        </telerik:RadToolBarButton> 
                        <telerik:RadToolBarButton   
                                                    Value="Save" 
                                                    CommandName="SaveSks" 
                                                    ImageUrl="~/Save.png"   
                                                    runat="server"   
                                                    Text="Save">  
                        </telerik:RadToolBarButton> 
                    </Items> 
                </telerik:RadToolBar> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <telerik:RadGrid ID="Sks" runat="server" GridLines="None" 
                    AllowMultiRowEdit="True" Width="100%"   
                    AutoGenerateColumns="False" onitemdatabound="Sks_ItemDataBound">  
                    <HeaderContextMenu> 
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </HeaderContextMenu> 
     
                   <ClientSettings AllowDragToGroup="false" AllowColumnsReorder="false" ReorderColumnsOnClient="false" AllowColumnHide="True" AllowRowHide="True">  
                        <Scrolling AllowScroll="true" ScrollHeight="280" /> 
                    </ClientSettings> 
     
                    <MasterTableView EditMode="InPlace" runat="server">  
                        <RowIndicatorColumn> 
                            <HeaderStyle Width="20px"></HeaderStyle> 
                        </RowIndicatorColumn> 
                         
                         <Columns> 
     
                            <telerik:GridBoundColumn DataField="CId" UniqueName="CId"   
                                Visible="false">  
                            </telerik:GridBoundColumn> 
                              
                            <telerik:GridBoundColumn DataField="ON"   
                                UniqueName="ON" Visible="false">  
                            </telerik:GridBoundColumn>   
     
                            <telerik:GridDropDownColumn DataField="Pe" HeaderText="" 
                                UniqueName="Pe" ListTextField="Value" ListValueField="TabIndex">  
                                <ItemStyle Width="150px" /> 
                            </telerik:GridDropDownColumn> 
                                                     
                             
                        </Columns>                     
     
                    </MasterTableView> 
                    <FilterMenu> 
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </FilterMenu> 
     
                </telerik:RadGrid> 
            </td> 
        </tr> 
    </table> 

    thanks a lot

  2. Peter
    Admin
    Peter avatar
    6637 posts
    Member since:
    Sep 2012

    Posted 04 Aug 2009 Link to this post

    Hi Laz,

    The code looks correct. Can you open a support ticket and send us a simple working demo which we can test?

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

  3. DevCraft Release
  4. Puneet Jain
    Puneet Jain avatar
    5 posts
    Member since:
    Feb 2010

    Posted 11 Mar 2010 Link to this post

    I am also facing the same problem.


     <telerik:RadToolBar ToolTip="Please click to see available options..." runat="server"
                            ID="MeasureActionToolbar" OnButtonClick="actions_OnSelectedIndexChanged"
                            Visible="false" OnClientButtonClicked="OnClientSelectedIndexChanging" MeasureID='<%#Eval("Measure_ID") %>'>
                        </telerik:RadToolBar>  

    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
        <script language="javascript" type="text/javascript">
            function OnClientSelectedIndexChanging(sender, args) {
                alert("OnClientSelectedIndexChanging");            
            }
        </script>
    </telerik:RadCodeBlock>

    Please help 

  5. Laz
    Laz avatar
    31 posts
    Member since:
    Apr 2009

    Posted 11 Mar 2010 Link to this post

    Hi,
    in my scenario the problem was that i load the controls on demand for example a RadTab - Control. In this scenario the javascript part doesn´t registered. I solve the problem that i created serverside with

    ScriptManager.RegisterClientScriptBlock 

    I hope i helps

  6. Puneet Jain
    Puneet Jain avatar
    5 posts
    Member since:
    Feb 2010

    Posted 11 Mar 2010 Link to this post

    Hi

    Dont know why but changing function name helped to me 

Back to Top
DevCraft Release