RadPanelBar ItemClik no PostBack

6 posts, 0 answers
  1. Danijel
    Danijel avatar
    1 posts
    Member since:
    Jul 2008

    Posted 06 Aug 2008 Link to this post

    I have changed version of Rad Controls from Q1 2008 to Q2 2008. Since then I have problems with RadPanelBar. Previously if I click on item I got a PostBack and ItemClick event was fire. Now, with Q2 version there is no PostBack and ItemClick event isn't fire. It looks like action to navigate to next site is taken client-side. Only time I get ItemClick event fired is, when there is no NavigateUrl specified. What can I do to have NavigateUrl specified and get ItemClick event fired?
     
    Thanks,
     
    Danijel Radjenovič
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Aug 2008 Link to this post

    Hi Danijel,

    I tested the described scenario with Q1 2008 and Q2 2008 versions of RadControls and RadPanelBar behaves the same - when NavigateUrl property is specified, the page is redirected and ItemClick event is not fired.

    I suggest you set a custom attribute instead of NavigateUrl to the panelbar items and store in it the value of the NavigateUrl, in this case ItemClick is always fired and in its handler you can retrieve the NavigateUrl value and redirect the page manually.

    Please check the attached sample project for a reference.

    Best wishes,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ethan
    Ethan avatar
    3 posts
    Member since:
    Oct 2007

    Posted 06 Aug 2008 Link to this post

    Hello, I have the same issue and I need to postback to the ItemClick event using JavaScript.  I previously used

    __doPostBack(

    '<%= RadPanelBar1.ClientID %>',sServerID);
    or

    __doPostBack(

    "<%= RadPanelBar1.ClientID %>", 'RadPanelbar1$i0$i1');

    Now, it causes a postback, but does not fire the ItemClick event.  Does anyone know the new way to do this with JavaScript?  Thanks!

  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 Aug 2008 Link to this post

    Hello Ethan,

    Please check whether NavigateUrl property of RadPanelBar items is set, because in this case ItemClick event is not fired. As I explained in my previous post, you can set a custom attribute and store the NavigateUrl value in it, then clear the NavigateUrl property so ItemClick always fires.
    If you want to execute some client-side code before the postback, you can subscribe to OnClientItemClicking event.


    Please download the attached project and give it a try.

    All the best,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Terry
    Terry avatar
    5 posts
    Member since:
    Oct 2008

    Posted 06 Jul 2010 Link to this post

    I have tried to use this but it still does not give me what I need. I am binding the RadPanelBar to a SQL Datasource and I assign the DatafieldID to the reference I want to use, I assign the Datatextfield to what I want to show. I don't assign anything to the URL property. When the user clicks the item I can get the text by using e.item.text but I need to get the record reference I assigned to the datafieldID. I would assign it to an attribute as you suggest but in the itembound event how do I access the datafieldID value?

    Terry
  7. Ethan
    Ethan avatar
    3 posts
    Member since:
    Oct 2007

    Posted 14 Jul 2010 Link to this post

    Hey Terry,  I'm not totally sure what you are asking.  Is this what you are looking for?

    RadPanelbar1.SelectedItem.Attributes(

    "DataFieldID"

    If not, post some code.

    Cheers.

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017