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

RadPanelBar HeaderTemplate

4 Answers 239 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Nishith
Top achievements
Rank 1
Nishith asked on 04 Oct 2011, 06:46 PM
I have created a HeaderTemplate for RadPanel by inheriting from ITemplate interface and binding the RadPanelBar dynamically. My HeaderTemplate contains a label and a RadButton. I just wanted to handle the Button click event(server-side) inside the HeaderTemplate. Can you please help me on this ?

I am able to handle the ItemClick event of the RadPanelItem but not sure how to handle the button click event separately. It will be great if you have some sample code for this.

Thanks,
Nishith

4 Answers, 1 is accepted

Sort by
0
Nishith
Top achievements
Rank 1
answered on 04 Oct 2011, 07:11 PM
I have another question, suppose I have used a RadPanelBar in my page and for the selected Item I wanted to put an arrow image at the border of the RadPanelPanel item ? Can it be possible using CSS and let me know if you have any work around to achieve this kind of style. I have attached the sample style I wanted for selected RadPanelItem.
0
Kate
Telerik team
answered on 05 Oct 2011, 11:07 AM
Hi Nishith,

You can refer to the following demo if you need to handle only the button click in the HeaderTemplate of the RadPanelBar. Considering your other question about the appearance of the RadPanelBar, in general we do not provide support for the look that you are trying to achieve. However, you could try to change the sprite image that is applied to the control and using the css classes of the RadPanelBar to adjust it according to your needs. Here are the classes that are used for the Header and for the arrow, for example and a help article that explains how you can customize the skin of the control:
.RadPanelBar_Vista div.rpHeaderTemplate, .RadPanelBar_Vista a.rpLink {
    background-color: #A6D9F4;
    background-image: url("PanelBar/RootItemBg.png");
/* the image that you can change */
    border-color: #E8F5FC;
}

.RadPanelBar_Vista .rpExpandable span.rpExpandHandle, .RadPanelBar_Vista .rpExpanded span.rpExpandHandle {
    background-color: transparent;
    background-image: url("PanelBar/Expandable.png");
/* the arrow image that is used */
    background-repeat: no-repeat;
}

Best wishes,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Nish
Top achievements
Rank 1
answered on 25 May 2013, 05:36 AM
Hi Telerik Team,

The Demo link you have given above is showing how to open a RadWindow using javascript. But I need to handle the button click event on serverside.

I am able to handle the ItemClick event of the RadPanelItem but not sure how to handle the button click event separately. It will be great if you have some sample code for this.

Thanks,
Nish
0
Kate
Telerik team
answered on 30 May 2013, 11:20 AM
Hello Nish,

You can create the header and/or content templates of the RadPanelItems on the server side and attach the event handler to the button in the header as desired. Here is a very good help article explaining how to achieve that. I also attached a very simplified runnable page that you can use as a start.

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
PanelBar
Asked by
Nishith
Top achievements
Rank 1
Answers by
Nishith
Top achievements
Rank 1
Kate
Telerik team
Nish
Top achievements
Rank 1
Share this question
or