Showing posts with label depending. Show all posts
Showing posts with label depending. Show all posts

Wednesday, March 28, 2012

tab control

I would like to hide a panel later in the page depending on which tab is active. Is there a way to check for the active tab?

Hey,

I believe the tabcontainer has an SelectedIndex or ActiveIndex property, or something similar, which contains the index of the active tab.

Monday, March 26, 2012

Tab Control Change Tab Colors

I have a customer that wants the Tab Control to have specific colors for the tabs depending on which tab is clicked. I have been able to use the CssClass to get the hover to be the way they would like but the active tab they would like it to be a different color.

I have attempted to write VB behind code as follows

sub onTabChange(byval sender as object, byval e as system.eventargs)

Select Case TabContainer1.ActiveTab

Case 1

TabContainer1.CssClass = "ajax__tab_tab1"

Case 2

......

end sub

I have the Sub as the onActiveTabChange property of the tab control. I do not get any debugging stop in the code behind page or any indication that there is a call to the sub from the control.

I just need a way to change the colors on each tab depending on which tab is active.

Hi,

Please make sure the AutoPostBack property of the Tab control is set to true.

If this doesn't work, please post a stripped version of your page here.


The autopostback property was the resolution

Thank you.

Saturday, March 24, 2012

Tab panel problems

Ok, Here's the situation.

I've made a crm with a relations section. on the relation section there are always 4 tabs. but depending on the connection links with other relations there can be added more

so i have to add the tabs programmaticly. this is no problem. but on the first tab there is a detailsview where i edit the relation details. This all works perfectly. I can see the extra tabs and it all looks nice but the problem is when i try to edit the first tab

when i programaticly add the tabs for the relations the edit function on the first tab doesnt work anymore. I also tried only adding one tab. and that doesnt works also. Any ideas?

Error:
Specified argument was out of the range of valid values.
Parameter name: index

Codebehind:
Sub Page_Load(ByVal senderAsObject,ByVal eAs EventArgs)HandlesMe.Load

If (Request.QueryString("action") = 2)Then
FormView1.ChangeMode(FormViewMode.Insert)
tab3.Enabled =False
tab4.Enabled =False
tab5.Enabled =False

Else

If IsPostBackThen

Else

Dim tempTabAs AjaxControlToolkit.TabPanel =New AjaxControlToolkit.TabPanel
tempTab.ID ="tab6"
tempTab.HeaderText ="temptab"

ajaxtab.Controls.Add(tempTab)

EndIf
EndIf

EndSub

System.ArgumentOutOfRangeException was unhandled by user code
Message="Specified argument was out of the range of valid values.\r\nParameter name: index"
Source="System.Web"
ParamName="index"
StackTrace:
at System.Web.UI.ControlCollection.get_Item(Int32 index)
at AjaxControlToolkit.TabPanelCollection.get_Item(Int32 index) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\Tabs\TabPanelCollection.cs:line 49
at AjaxControlToolkit.TabContainer.LoadClientState(String clientState) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\Tabs\TabContainer.cs:line 353
at AjaxControlToolkit.ScriptControlBase.LoadPostData(String postDataKey, NameValueCollection postCollection) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 303
at AjaxControlToolkit.TabContainer.LoadPostData(String postDataKey, NameValueCollection postCollection) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\Tabs\TabContainer.cs:line 444
at AjaxControlToolkit.ScriptControlBase.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 414
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

-------

It doesnt even come past the ispostback on the edit button click


ok got it.. needs to be on page_oninit