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

RadPanelBar ItemClik no PostBack

5 Answers 278 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Danijel
Top achievements
Rank 1
Danijel asked on 06 Aug 2008, 11:16 AM
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č

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 06 Aug 2008, 03:17 PM
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.
0
Ethan
Top achievements
Rank 1
answered on 07 Aug 2008, 02:04 AM
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!

0
Yana
Telerik team
answered on 08 Aug 2008, 02:28 PM
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.
0
Terry
Top achievements
Rank 1
answered on 06 Jul 2010, 07:08 PM
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
0
Ethan
Top achievements
Rank 1
answered on 14 Jul 2010, 03:45 PM
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.

 

Tags
PanelBar
Asked by
Danijel
Top achievements
Rank 1
Answers by
Yana
Telerik team
Ethan
Top achievements
Rank 1
Terry
Top achievements
Rank 1
Share this question
or