Panel Bar

4 posts, 0 answers
  1. John ryan
    John ryan avatar
    3 posts
    Member since:
    Jun 2013

    Posted 07 Jun 2013 Link to this post

    I've created a panel bar in codebehind  and I want to include the onclick event of it,. below are my sample source code

      protected void Page_Load(object sender, EventArgs e)
        {
             RadPanelItem item11 = new RadPanelItem();
            item11.Text = "Add Security Question"; item1.Items.Add(item11);
            item11.ImageUrl = "Img/Slidding/TabstripPr.gif";
       
            ---here i want to register the onclick event  of the panelitem but i dont know how to do it.
            ---the idea of doing this is to build dynamic slidding menu bar through code behind and load the user control inside the tabstrip

           thanks,
        ryan

    }
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Jun 2013 Link to this post

    Hi,

    You can catch the click event for a panelbar item by itemclick event of RadPanelBar as shown below.
    C#:
    protected void Page_Load(object sender, EventArgs e)
      {
         RadPanelItem menuitem = new RadPanelItem();
         menuitem.Text = "Test";
         Radpanelbar1.Items.Add(menuitem);
         Radpanelbar1.ItemClick += new RadPanelBarEventHandler(Radpanelbar1_ItemClick); //to attach itemclick event
      }
      
    void Radpanelbar1_ItemClick(object sender, RadPanelBarEventArgs e)
      {
           if (e.Item.Text == "Test")
           {
               //your code
           }
       }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John ryan
    John ryan avatar
    3 posts
    Member since:
    Jun 2013

    Posted 07 Jun 2013 Link to this post

    It works. thanks
  5. John ryan
    John ryan avatar
    3 posts
    Member since:
    Jun 2013

    Posted 07 Jun 2013 Link to this post

    Another question, if there is a way by which I can integrate my outlook mail in telerik control?if such, can you gave me  tips on how I can do it?

     thanks for you quick reply.
Back to Top