I'm having a TabContainer with TabPanels which can gow repectively, according to their specific content.
I whish to force the TabContainer Height to be fixed to the Height of the highest TabPanel (so it won't grow / shrink according to current selected Tab, on tabChange event).
I've tried (in code behind Page_Load event) :
AjaxControlToolkit.TabContainer container = (AjaxControlToolkit.TabContainer)Tabs;
Unit minheight = 100;
foreach (object obj in container.Controls)
{
if (obj is AjaxControlToolkit.TabPanel)
{
AjaxControlToolkit.TabPanel tabPanel = (AjaxControlToolkit.TabPanel)obj;
if (tabPanel.Height.Value > minheight.Value)
{
minheight = tabPanel.Height;
}
}
}
container.Height = minheight;
but it's not working (probably since my tabs doesn't have any height specified, logically !) .
nicolas.fort...
Member
4 Points
5 Posts
Setting TabContainer Height according to highest TabPanel
Dec 09, 2012 09:13 PM|LINK
Hi all,
I'm having a TabContainer with TabPanels which can gow repectively, according to their specific content.
I whish to force the TabContainer Height to be fixed to the Height of the highest TabPanel (so it won't grow / shrink according to current selected Tab, on tabChange event).
I've tried (in code behind Page_Load event) :
AjaxControlToolkit.TabContainer container = (AjaxControlToolkit.TabContainer)Tabs; Unit minheight = 100; foreach (object obj in container.Controls) { if (obj is AjaxControlToolkit.TabPanel) { AjaxControlToolkit.TabPanel tabPanel = (AjaxControlToolkit.TabPanel)obj; if (tabPanel.Height.Value > minheight.Value) { minheight = tabPanel.Height; } } } container.Height = minheight;but it's not working (probably since my tabs doesn't have any height specified, logically !) .
Any ideas ?
Thanks in advance
Nicolas
chetan.sarod...
All-Star
65649 Points
11133 Posts
Re: Setting TabContainer Height according to highest TabPanel
Dec 10, 2012 02:35 AM|LINK
Do not set any fixed height/width. Tab Panel resizes by the content by default.
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
nicolas.fort...
Member
4 Points
5 Posts
Re: Setting TabContainer Height according to highest TabPanel
Dec 11, 2012 10:37 PM|LINK
I hnow that. But what if all tab content don't have the same height ? On each tab change, the control resizes itself.
This is what I want to avoid.
Thanks in advance
N. Fortin