Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Wednesday, March 28, 2012

Tab Container Height

This is more of a display question than anything, but I wasn't sure where else to ask, so here goes :)

I've got 2 table cells right next to each other. One of them is much taller than the one that has my tab container in it. Is there a way I can programatically set the height of the tab control so that it's forced to be as tall as the other table cell? Or heck, if it could just fill up the cell it's in, that'd be fine.

Any help is appreciated, much thanks!

-- Dan

Use the height attribute.


rpack79:

Use the height attribute.


How can I apply the height attribute dynamically based on the size of the cell next to it? I can't assign a height in pixels to it, everything is sized to scale.


Post your code and I'll show you.


How about using % instead of px.

Monday, March 26, 2012

Tab Control doesnt display correctly within User Control

I've tried searching for answers to this but the search facility seems to not be working at the moment, so please forgive me if there are similar posts in here somewhere which I just can't see.

I don't know whether I'm the only person here trying to use these controlkit controls inside my own user controls, but it seems that every time I try I get mysterious problems! I'm dynamically adding Tab Panels to a Tab Container in the Container_Init function. This works beautifully in a straight aspx page, but as soon as I place the Tab Container within an ascx page, I get little white blocks appearing at runtime in front of each Tab "header" area, starting about halfway down each one and slightly offset to the left, so that only the top half of the tab header text is visible. Also there is a solid line (albeit with a tiny gap at the right-hand end) between the active tab header and the corresponding panel, so there is no sense of the header belonging to the active tab.

Any hints anyone?

_Ade.

Well I won't say I've "solved" this problem, but I have come up with a totally bizarre workaround.

By dint of tediously commenting out each element of the supplied css class line by line and rebuilding, I finally realised that the defaultajax__tab_tabclass has a hard-coded height of 13px, and in the specific case where the tab container is contained within a user control, increasing this height to 21px fixes the problem!

Does anyone know what this is all about? Will it come back and bite me again when it wakes up?

_Ade.


Try add the following to your user control:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Good luck.


I added the line and it makes no difference. Unless I change the ajax__tab_tab class Height from 13px to 21px it doesn't display correctly.

_Ade.


Where did you add it to? Try to add it to the page consuming the user control to see if works.


Yep, it worked!

10xvljw8202.


Well actually, it did fix the tab display, but it screwed up the formatting of the rest of the page and every other page in my application!

I'm sticking with resetting the css file to 21px height.

_Ade.


Please help !

I have set the height as 21 px as mentioned, but the tags are still broken.

Is there anybody experience the same problem?

Thanks


Found out the solution finally.

I put the code "<script language='Javascript'>window.resizeTo(screen.width,screen.height); self.moveTo(0,0);</script>" on aspx.vb file.

In order to solve the broken tags problem. remove the code from .aspx.vb file, and put them into .aspx file.

I hope it helps.

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

TabContainer and DropDownList

Hi!

I've got a User Control that contains a DropDownList with AutoPostBack=true and theSelectedIndexChanged event is wired.

I've tested my User Control in a blank .aspx page and it works fine!


Now, if I add this User Control in a TabContainer and run it again, it stoppes behaving as it should: SelectedIndexChanged doesn't trigger and the list is empty after postback.

Has anybody experienced the same kind of problem?

Thanks!

Hi,

Please post your code so i can review it and then give you a logical explanation for this


Hi ,

You could try adding an UpadatePanel inside the Tab and then add the user control inside the Updatepanel.

George

Wednesday, March 21, 2012

TabContainer doesnt maintain active tab after click on TreeView node

Hello,

I've got a small probleme with TabContainer and a treeview. When I click on a TreeView node, the TabContainer doesn't maintain its active tab after postback.

Here is a test page. To reproduce the problem, select the second tab, then click on any of the node inside the Tree.

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> </head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager> <asp:TreeView ID="treeview" runat="server"> <Nodes> <asp:TreeNode Text="root" Value="root"> <asp:TreeNode Text="item1" Value="item1"></asp:TreeNode> <asp:TreeNode Text="item2" Value="item2"></asp:TreeNode> </asp:TreeNode> </Nodes> </asp:TreeView> <ajaxToolkit:TabContainer ID="container" runat="server"> <ajaxToolkit:TabPanel HeaderText="tab 1" runat="server" ID="tab1"></ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel HeaderText="tab 2" runat="server" ID="tab2"></ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </div> </form></body></html>

It doesn't work with LinkButton postbacks, too, and probably with everything that uses __doPostBack() calls...

TabContainer Issue

I've created a webform that has a modal dialog box that retrieves data from a database, then returns those values to the parent form. This functionality works fine. I recently added a tabcontainer in hopes to add tabs to the parent web form. After reformatting my form with the tabcontainer and tab panel, everything seem to be working fine until I tested the modal dialog box. It does open but when trying to pass information back to the parent form, it doesn't seem to find the fields. I am using the "document.getElementbyID" with no luck. Below is my javascript function that does work as soon as I remove the tabcontainer with its corresponding tab panel. I put them back and it doesn't work, it does return the followingerror "document.getElementById(...) is Null or not an object"

function openwindow()
{
var txt2 = window.showModalDialog("../Lookups/GroupLK.aspx", "mywindow","status=0,toolbar=0, width=700, height=250, scrollbars=1", txt2);
if (txt2 == null)
{
window.alert("Operation Cancelled");
}
else
{
document.getElementById("txtGroup").value=txt2[1].toString();
document.getElementById("txtGroupID").value=txt2[0].toString();
}
}

Any advice from the experts would be greatly appreciated. I really like to use these tabs on my form.

try using

document.getElementById('<%= txtGroup.ClientID%>').value=txt2[1].toString();
document.getElementById('<%= txtGroupID.ClientID%>').value=txt2[0].toString();


Yes...that did it thank you! But I am still puzzled by the whole "tab container" concept. Why are fields somehow not available. After making the changes as you mentioned above, and proceeding to submit my form the sqldatasource1.insert() is not working. I get the following error "Could not find control 'txtReceived' in ControlParameter 'letter_recv_date' ". Again, if I remove the tab container and leave all the fields onto a form, it works fine. Any additional insights would be appreciated.


Hi Rnino3,

Control's ID usually does same as its ClientID when the control is inside another Container.

For example, TextBox1 inside TabContainer1 , its ClientID should be TabContainer1_TabPanel1_TextBox1. You can find in the generated HTML code. So in your situation, please use <"%=txtReceived.ClientID%"> instead of txtReceived.

Best regards,

Jonathan