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

Scrollbar in Radpanelbar item

8 Answers 365 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 19 Mar 2013, 11:30 AM
Hi There,
I have a requirement to display vertical and horizontal scroll bars in RadPanelbar item when its content is large, but Radpanel bar doesnt support this, instead it stretches vertically/horizontally as much as we have the content,  and the last radpanelbar item will hide at the bottom of the Radpanelbar. 
Please verify the screenshot for more information(what we are expecting is depicted in the screenshot).

Regards,
Srinivas.

8 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 20 Mar 2013, 12:09 PM
Hi Srinivas,

This issue is caused by the RadPanelBar default template which wraps the ItemsPresenter (representing the PanelBarItems) in a ScrollViewer control. This is why in order to get over this behavior, you  will have to edit the default ControlTemplate of the control to remove the ScrollViewer.

I attached a sample solution demonstrating this approach so please have a look at it and let me know if it helps.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ravi
Top achievements
Rank 1
answered on 21 Mar 2013, 11:01 AM
Hi Tina Stancheva ,

When we set IsExpand="true" to all PanelBarItems then we dont see the Panels which are at the bottom of the RadPanelbar. is there any way that i can control the scrollviewer in both cases (for PanelBar and PanelBarItem)

Regards,
Srinivas.

0
Tina Stancheva
Telerik team
answered on 26 Mar 2013, 11:24 AM
Hi Srinivas,

Thank you for getting back to us. Unfortunately the RadPanelBar control doesn't support such a behavior out-of-the-box. However, you can customize the RadPanelBarItems resizing logic handling the Expanded and Collapsed events in order to implement your customizations.

For example you can calculate the MaxHeight of each item based on the ActualHeight of the RadPanelBar and the default ActualHeight of the collapsed PanelBarItem which by default is about 22px. Using this approach I prepared a sample project which customizes the RadPanelBarItem's MaxHeight property based on the count of all items and the ActualHeight of the PanelBar control at a given moment.

Please note that in the attached solution, the RadPanelBar default style isn't changed, which means that it still contains a ScrollViewer but I have disabled the scroll bars. Let me know if this helps.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Arpit
Top achievements
Rank 1
answered on 11 Dec 2017, 01:56 PM
Hi , I have unzip the code but the files are blank, Could you please help me?
0
Vladimir Stoyanov
Telerik team
answered on 14 Dec 2017, 12:12 PM
Hello,

I downloaded the project and the files are OK on my side. May I ask you for some additional information in order to assist you? Which program are you using to unzip the archive? Also what program are you trying to open the files with?

I am looking forward to your answer.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Eran
Top achievements
Rank 1
answered on 24 Mar 2018, 02:37 PM

i have ObservableCollection<Job> which RadPanelBar is bound to.

when i try to implement your solution i can't fins the way to convert from Job type to RadPanelBarItem and to set MaxHeigh.

can you please suggest how should i do that?

 

thanks in advance,

0
Vladimir Stoyanov
Telerik team
answered on 27 Mar 2018, 11:31 AM
Hello Eran,

Since when binding the ItemsSource of the RadPanelBar to custom objects, those objects are wrapped in RadPanelBarItems before being pushed in the Items collection of the RadPanelBar, you can still access them though the ContainerFromItem method of the ItemContainerGenerator. That would look something like this:
var panelBarItem = myPanel.ItemContainerGenerator.ContainerFromItem(myPanel.Items[0]);

Please note that in the above snippet "myPanel" refers to the RadPanelBar instance that you are targeting.

Hope this helps.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Eran
Top achievements
Rank 1
answered on 28 Mar 2018, 12:10 PM

That was very helpful, thanks a lot.

Tags
PanelBar
Asked by
Ravi
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Ravi
Top achievements
Rank 1
Arpit
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Eran
Top achievements
Rank 1
Share this question
or