Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Wednesday, March 28, 2012

Tab container width

Can the container width be set somehow to dynamically adjust based on it's content?

I have a 3 tabbed container with a Gridview within one of them. The edit mode of the Gridview is wider than when it is in Read mode. So lets say the default with of the container would be set to 600px, but when the Gridview goes into edit mode it might be 800px. The Gridview in edit mode will go right over the 'border' of the container in this case. Can this be configured to work change the width dynamically based on it's content, or do I have to figure out the widest instance and set it to that or programatically change the width on the container when the Gridview goes to edit mode?

Thanks

Mark,

could you post some of your HTML/ASP.NET declaration for the Tab and Content? The Tab is resizing quite well here...

Alexander

Monday, March 26, 2012

Tab Control is throwing an exception on postback

I have a tab container control on my page located within a view. When the view is activated I do a query and dynamically add the tabs based on a query like so:

 DataTable tblCollAttrs = oBAL.GetCollectionAttrs(DetailItemID);foreach(DataRow drowin tblCollAttrs.Rows) { TabPanel collTabPnl =new TabPanel(); collTabPnl.HeaderText = drow["vchAttributeName"].ToString(); relTablContainer.Tabs.Add(collTabPnl); }

So far everything is fine. Now I click an unrelated button which does a full postback that switches the view and I get this exception:Specified argument was out of the range of valid values. Here is where it is crashing in TabPanelCollection.cs:

public new TabPanel this[int index]
{
: get { return (TabPanel)base[index]; }
}

What am I missing here?

Unfortunately, the tab control does not play nice with dynamically added tabs. It does not re-create them during pre-init, and when it goes to set the active tab, you get the error you are seeing because the active tab index is greater than the number of tabs.


Is there anyway around this?


HiI have also this problem.please help me.

Because of this limitation I was unable to use this AJAX control. I ended up creating my own TabStrip control and putting it in an UpdatePanel.

Sorry I don't have a better response.