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

Setting the PanelBar Height programmatically

5 Answers 196 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 07 May 2008, 09:49 AM
How in the name of the Gods do I do this?

I thought that it'd be nice and simple, something like:

var pb = $find("<%=PanelBar.ClientID%>"); 
pb.height = "200px"
Sadly, that doesn't work.

Nor does setting the style.height property of the result of "get_element()".

What I'm trying to do is have the PanelBar occupy the full height of a Splitter Pane with ExpandMode set to "FullExpandedItem". With this setting, you can't just set the height to 100% and expect it to work. The boys at telerik towers tell me that this isn't supported and it certainly doesn't work; you have to set an explicit height for the PanelBar to get any oversized child group to scroll.

Which leaves me back at the start of this message. How do I explicitly set the height of the PanelBar?

Why is it always the simple seeming things that take the time ...?

--
Stuart

5 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 07 May 2008, 12:21 PM
Hello Stuart,

There are two possible options for achieving your goal. Here there are:

1)
<script type="text/javascript">  
function pageLoad()  
{  
    var pb = $find("<%=RadPanelBar1.ClientID%>");    
    pb.get_element().style.height = "500px";  
}  
</script> 

2)
<script type="text/javascript">  
function pageLoad()  
{  
    var pb = $get("<%=RadPanelBar1.ClientID%>");    
    pb.style.height = "500px";  
}  
</script> 


Best wishes,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dan
Top achievements
Rank 1
answered on 07 May 2008, 01:51 PM
Cheers Paul,

Sadly, in practice that doesn't appear to do the trick (it does resize, just not with the expected results).

I've raised support ticket 136554 to try and solve the underlying issue.

--
Stuart
0
Dan
Top achievements
Rank 1
answered on 08 May 2008, 03:50 PM
The answer is to include in your JavaScript a call to the Panelbar's repaint() method.

--
Stuart
0
Andreas Kaech
Top achievements
Rank 1
answered on 30 May 2008, 07:16 PM
Hi Stuard,
repaint() ? Looks like "undocumented".
Now 2 questions:
- In what situations we need to call this method?
- Does other controls has this method?

Thanks for answering,
Andreas
0
Dan
Top achievements
Rank 1
answered on 02 Jun 2008, 07:18 AM
Andreas,

You're right; repaint() is an undocumented method. I was told to use it by someone at telerik towers.

In answer to your questions...

1. In my case it was where the the style of the PanelBar was being changed, client-side after the control had fully rendered. In particular, in the resize event of the container (a RadSplitter).

I can't say why this is necessary, I only know that it is. It could be something to do with the order in which controls are rendered, but that's a bit of a wild guess. If you need a more conclusive reply, you're going to need a grown-up to answer.

2. I've not a clue. I suspect you could find out by examining the source code or my using something like FireBug in FireFox to examine the objects on your page.

--
Stuart
Tags
PanelBar
Asked by
Dan
Top achievements
Rank 1
Answers by
Paul
Telerik team
Dan
Top achievements
Rank 1
Andreas Kaech
Top achievements
Rank 1
Share this question
or