Click here to Skip to main content
15,885,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi, I got many tabs inside ajax tab container that cannot be fit into one row. So I would like to create a horizontal scroll tab for ajax tab container to fit all tabs into a single row.

I have tried research online for quite awhile but still couldn't find a solution to it. My ajax tab container and tab panel would be created dynamically in c#.

This is the output that I would like to achieve: (See here: http://i.stack.imgur.com/bUnK4.png[^])
This is my codes:
ASP.NET
//Aspx file
 <div>
             <asp:scriptmanager ID="ScriptManager1" runat="server">
            </asp:scriptmanager>
        </div>
        <asp:updatepanel ID="UpdatePanel1" runat="server" ScrollBars="Horizontal">
            <contenttemplate>
        <asp:placeholder ID="PlaceHolder1" runat="server"></asp:placeholder>
 
                <asp:Chart runat="server">
 
                </asp:Chart>
 
            </contenttemplate>
        </asp:updatepanel>
 
//Cs file
AjaxControlToolkit.TabContainer container = new AjaxControlToolkit.TabContainer();
            container.ID = "TabContainer";
            container.EnableViewState = false;
            container.Tabs.Clear();
            container.Height = Unit.Pixel(2000);
            container.Width = Unit.Pixel(2000);
            container.Tabs.AddAt(0, GetManualTab());

  AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
                    panel.HeaderText += item.Text;
                    container.Tabs.Add(panel);


Question: How to create a horizontal scroll tab for ajax tab container in order to fit many tabs into one row?

Appreciate if someone could provide me help on this. Thanks!

Regards,
Felicia
Posted
Updated 30-Sep-15 20:00pm
v2

ASP.NET
<cc1:tabpanel id="TabPanel1" runat="server" headertext="TabPanel1" xmlns:cc1="#unknown">
	<contenttemplate>
	    <asp:panel runat="server" id="Panel1" scrollbars="Horizontal/Vertical" xmlns:asp="#unknown">
	        <asp:textbox id="TextBox1" runat="server" width="300px" height="30px"></asp:textbox>                 
	    </asp:panel>
	</contenttemplate>
</cc1:tabpanel>

http://www.nullskull.com/q/10136937/how-to-give-scroll-bar-in-ajax-tab-container.aspx[^]

-KR
 
Share this answer
 
Comments
Member 11999641 1-Oct-15 3:20am    
hi KR, as my panel is created dynamically, so I am not able to use this method to create the scrollbars. Do you have any other solution for me? Thanks for your help!
instead use jquery tabs

https://jqueryui.com/tabs/[^]

it uses div tag for holding tabs. so u can specify a fixed width to div and then set its ovreflow attribute.

hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900