This is a migrated thread and some comments may be shown as answers.

ReorderTabsOnSelect not working

4 Answers 96 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 09 Apr 2009, 07:57 AM
Hi all

What would cause the  ReorderTabsOnSelect="True" not to work? It did not work on the 2008 Q2, but I got around it with the TabStrip CSS files. These have gone to pieces now with the 2009 Q1 version, but I would be OK with the reorderonselect.

My guess would be its a postback / reload issue but has anyone had a simiar problem.

My Fill routine:

 

Private Sub FillTabs()

 

Dim Expert As New clsExpert

 

Dim TabDat As Data.DataTable = Expert.GetAssessmentScales()

 

With RadTabStrip

.DataFieldID =

"AssessmentScale_ID"

 

 

 

.DataFieldParentID =

"AssessmentScaleParent_ID"

 

 

.DataTextField =

"AssessmentScale_Title"

 

 

.DataValueField =

"AssessmentScale_ID"

 

 

.DataSource = TabDat
.DataBind()

.ReorderTabsOnSelect =

"true"

 

End With

 

End Sub

 


My Mark up
<telerik:RadTabStrip

 

 

ID="RadTabStrip"

 

 

runat="server"

 

 

EnableEmbeddedSkins="true"

 

 

Skin="Outlook"

 

 

SelectedIndex="0"

 

 

ReorderTabsOnSelect="True"

 

 

PerTabScrolling="True">

 

</telerik:RadTabStrip>

 


Andy

4 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 09 Apr 2009, 09:02 AM
Hi Andy,

In order to reorder tabs on select you will have to have multirow tabstrip structure. This is accomplished by setting IsBreak="true" to particular tab in your tabstrip. Please refer to our Multi-row example for details on the matter.

Best wishes,
Paul
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Andy Green
Top achievements
Rank 2
answered on 09 Apr 2009, 09:33 AM
Thanks - As my tabs move to multiple rows on browser window resize I assumed that it was automatice.

Any clues on how to set the IsBreak="true"  on a tab that comes from a data base at runtime.

Andy
0
Accepted
Paul
Telerik team
answered on 09 Apr 2009, 10:51 AM
Hello Andy,

Please find below a sample code snippet that shows the needed approach.

ASPX:
<form id="form1" runat="server">  
<asp:ScriptManager ID="ScriptManager1" runat="server">  
</asp:ScriptManager> 
<telerik:RadTabStrip ID="RadTabStrip" runat="server" Skin="Outlook" SelectedIndex="0" 
DataFieldID="MenuId" DataSourceID="SqlDataSource1" DataTextField="Text" OnTabDataBound="RadTabStrip_TabDataBound" 
ReorderTabsOnSelect="true" Align="Justify">  
</telerik:RadTabStrip> 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>" 
SelectCommand="SELECT [MenuId], [Text] FROM [panel]"></asp:SqlDataSource> 
</form> 

Code-behind:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
 
public partial class _Default : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
                 
    }  
    protected void RadTabStrip_TabDataBound(object sender, RadTabStripEventArgs e)  
    {  
        if ((e.Tab.Index + 1) % 3 == 0)  
        {  
            e.Tab.IsBreak = true;  
        }  
    }  
}  
 


Kind regards,
Paul
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Andy Green
Top achievements
Rank 2
answered on 09 Apr 2009, 11:48 AM
Excellent - worked first time, no on with the styling tweaks.
Andy
Tags
TabStrip
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Paul
Telerik team
Andy Green
Top achievements
Rank 2
Share this question
or