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

ButtonClick event problem

2 Answers 145 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
John Davis
Top achievements
Rank 2
John Davis asked on 06 May 2008, 10:58 AM
I am a new user.  I tried to follow the documentation. But...

This user control compiles with 
Compiler Error Message: CS0123: No overload for 'Ybasis_ButtonClick' matches delegate 'Telerik.Web.UI.RadToolBarEventHandler'

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Report_Graph_ViewControl.ascx.cs" Inherits="BalancedFlow.WebSite3._5.Controls.Reports.Report_Graph_ViewControl" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms" TagPrefix="chartfx7" %>
<%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register assembly="ChartFX.WebForms.Adornments" namespace="ChartFX.WebForms.Adornments" tagprefix="chartfxadornments" %>
<%@ Register assembly="ChartFX.WebForms" namespace="ChartFX.WebForms.Galleries" tagprefix="chartfx7galleries" %>

  
*** etc. ***

           <rad:RadToolBar Width="470px" Height="34px" Font-Size="Smaller" runat="server" ID="Ybasis"
            Skin="Outlook" UseFadeEffect="True" OnButtonClick="Ybasis_ButtonClick">
            <CollapseAnimation Duration="200" Type="OutQuint" />
            <Items>
             <rad:RadToolBarButton>
              <ItemTemplate>
               <asp:Label ID="lblUnits" runat="server" EnableViewState="false"
                Font-Bold="true" Font-Size="Smaller" Font-Underline="true" Text=" Units: "
                Width="47px"></asp:Label>
              </ItemTemplate>
             </rad:RadToolBarButton>
             <rad:RadToolBarButton AccessKey="l" Checked="True" CheckOnClick="True"
              CommandName="DOS" Group="YBasis" Text="DOS" ToolTip="DOS (Alt+L)" />
             <rad:RadToolBarButton AccessKey="c" CheckOnClick="True" CommandName="Qty"
              Group="YBasis" Text="Qty" ToolTip="Qty (Alt+C)" />
             <rad:RadToolBarButton AccessKey="r" CheckOnClick="True" CommandName="Cost"
              Group="YBasis" Text="Cost" ToolTip="Cost (Alt+R)" />
             <rad:RadToolBarButton IsSeparator="true">
             </rad:RadToolBarButton>
             <rad:RadToolBarButton IsSeparator="true">
             </rad:RadToolBarButton>
             <rad:RadToolBarButton CommandName="b1" Enabled="false" Text=" " Width="5px" />
             <rad:RadToolBarButton >
              <ItemTemplate>
               <asp:CheckBox ID="chkCutoff" runat="server" Font-Size="Smaller" Width="12px" />
              </ItemTemplate>
             </rad:RadToolBarButton>
             <rad:RadToolBarButton CommandName="Cutoff: " Font-Bold="true"
              Font-Size="Smaller" Font-Underline="true" Text="Cutoff: " Width="45px" />
             <rad:RadToolBarButton CommandName=" " Enabled="false" Width="5px" />
             <rad:RadToolBarButton CommandName="minus" ImageUrl="~\Images\minus.gif"
              ToolTip="minus" />
             <rad:RadToolBarButton >
              <ItemTemplate>
               <rad:RadNumericTextBox ID="txtCutoffLow" runat="server" ButtonsPosition="Right"
                MaxLength="9" MaxValue="99999" MinValue="0" NumberFormat-DecimalDigits="0"
                ShowSpinButtons="false" Skin="Default" Type="Number" Width="50">
               </rad:RadNumericTextBox>
              </ItemTemplate>
             </rad:RadToolBarButton>
             <rad:RadToolBarButton CommandName="  " Enabled="false" ToolTip=" "
              Width="5px" />
             <rad:RadToolBarButton CommandName="plus" ImageUrl="~\Images\plus.gif"
              ToolTip="plus" />
             <rad:RadToolBarButton >
              <ItemTemplate>
               <rad:RadNumericTextBox ID="txtCutoffHigh" runat="server"
                ButtonsPosition="Right" MaxLength="9" MaxValue="99999" MinValue="0"
                ShowSpinButtons="false" Skin="Default" Type="Number" Width="50">
               </rad:RadNumericTextBox>
              </ItemTemplate>
             </rad:RadToolBarButton>
            </Items>
           </rad:RadToolBar>

 

        protected void Ybasis_ButtonClick(object sender, RadToolBarButtonEventArgs e)
        {
 
        }

2 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 06 May 2008, 11:20 AM
Hi John,

The correct signature for the ButtonClick event handler is (object sender, RadToolBarEventArgs e). This comes, because the ButtonClick event can be fired by two different types of items - RadToolBarButton and adToolBarSplitButton. The RadToolBarButtonEventArgs class is used by the ButtonDataBound event only, as only RadToolBarButtons can be databound.

I hope this helps.

Best regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John Davis
Top achievements
Rank 2
answered on 06 May 2008, 12:58 PM
Erjan,
You fixed it, thank you.
John
Tags
ToolBar
Asked by
John Davis
Top achievements
Rank 2
Answers by
Erjan Gavalji
Telerik team
John Davis
Top achievements
Rank 2
Share this question
or