ButtonClick event problem

3 posts, 0 answers
  1. John Davis
    John Davis avatar
    119 posts
    Member since:
    Apr 2007

    Posted 06 May 2008 Link to this post

    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. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 06 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John Davis
    John Davis avatar
    119 posts
    Member since:
    Apr 2007

    Posted 06 May 2008 Link to this post

    Erjan,
    You fixed it, thank you.
    John
Back to Top