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

RadToolbarButton (OnClientButtonClicked)

4 Answers 303 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Laz
Top achievements
Rank 1
Laz asked on 04 Aug 2009, 11:41 AM

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

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Aug 2009, 12:58 PM
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.
0
Puneet Jain
Top achievements
Rank 1
answered on 11 Mar 2010, 11:42 AM
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 
0
Laz
Top achievements
Rank 1
answered on 11 Mar 2010, 01:38 PM
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
0
Puneet Jain
Top achievements
Rank 1
answered on 11 Mar 2010, 01:44 PM
Hi
Dont know why but changing function name helped to me 
Tags
ToolBar
Asked by
Laz
Top achievements
Rank 1
Answers by
Peter
Telerik team
Puneet Jain
Top achievements
Rank 1
Laz
Top achievements
Rank 1
Share this question
or