On item click event not executing.

5 posts, 0 answers
  1. G S S
    G S S avatar
    12 posts
    Member since:
    Sep 2007

    Posted 11 May 2009 Link to this post

    I have a rad splitter set up as follows:


    <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="522px" 
    Skin="Outlook" Width="243px">

    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" />
    <telerik:RadPane runat="server" Scrolling="Y">

    <telerik:RadPanelBar ID="RadPanelBar1" Runat="server" 
    onitemclick="RadPanelBar1_ItemClick1" Skin="Outlook" CausesValidation="False">
    </telerik:RadPanelBar>
    </telerik:RadPane>

    </telerik:RadSplitter>

    The onitemclick method exists in my codebehind (no compilation errors there). However, whenever I click an item in the panelbar, the page_load method is called and not the method specified above.


    Can anyone point out as to why?

  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 12 May 2009 Link to this post

    Hi G S S,

    We tried to repro the reported issie on our side, but to no avail. Here's a sample code snippet that works as expected on our side. Let us know what's different on your side.

    ASPX:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title></title>  
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1">  
        </telerik:RadScriptManager> 
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="522px" Skin="Outlook" 
            Width="243px">  
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
            <telerik:RadPane ID="RadPane1" runat="server" Scrolling="Y">  
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Outlook" CausesValidation="False" 
                    OnItemClick="RadPanelBar1_ItemClick">  
                    <Items> 
                        <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">  
                            <Items> 
                                <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                                </telerik:RadPanelItem> 
                                <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">  
                                </telerik:RadPanelItem> 
                            </Items> 
                        </telerik:RadPanelItem> 
                        <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2">  
                            <Items> 
                                <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                                </telerik:RadPanelItem> 
                            </Items> 
                        </telerik:RadPanelItem> 
                    </Items> 
                </telerik:RadPanelBar> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
        </form> 
    </body> 
    </html> 
     

    Code-behind:
    using System;  
    using System.Collections.Generic;  
    using System.Linq;  
    using System.Web;  
    using System.Data;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using Telerik.Web.UI;  
     
    public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
             
        }  
        protected void RadPanelBar1_ItemClick(object sender, RadPanelBarEventArgs e)  
        {  
     
        }  
    }  
     


    Greetings,
    Paul
    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. G S S
    G S S avatar
    85 posts
    Member since:
    Mar 2008

    Posted 12 May 2009 Link to this post

    Hi,

    The above code hits the correct event handler. Strange, but I think it's the way you setup the splitter.

    Thanks!

  5. Sandra Walters
    Sandra Walters avatar
    29 posts
    Member since:
    Dec 2005

    Posted 13 May 2009 Link to this post

    I'm encountering this problem also. In my case, the difference appears to be that the RadPanelBar is bound to a datasource.  My RadPanelBar loads its items just fine from the datasource, but the ItemClick server-side code is never called.  If I switch to a set of static items declared within the ASPX page, the ItemClick event works as expected.

    Here's my code snippet:
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" DataFieldID="PK_MenuItemID" 
        DataFieldParentID="MenuParentID"  
        DataTextField="DisplayText"  
        DataNavigateUrlField="Path" 
        DataSourceID="ldsTopMenu"  
        Width="100%"  
        OnItemClick="rpbLeftMenu_ItemClick"
    </telerik:RadPanelBar> 
    <asp:LinqDataSource ID="ldsTopMenu" runat="server" ContextTypeName="CoreDataContext" 
    OnSelecting="ldsTopMenu_OnSelecting"
     

    Is there something else I'm missing here?  Why is the ItemClick event never firing?
  6. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 14 May 2009 Link to this post

    Hi Sandra Walters,

    This is very strange. Could you please send us a sample page in a support ticket? We cannot reproduce this problem locally.

    Sincerely yours,
    Albert
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017