Question about selected tab in formview

6 posts, 0 answers
  1. Brian
    Brian avatar
    9 posts
    Member since:
    Dec 2007

    Posted 24 Jun 2010 Link to this post

    I've set up a tabstrip in the pager template of a formview and bound it to a SQLDatasource.  I then set up a server side OnTabClick event to change the page of the formview.  This works great.  The only issue I'm having is displaying the selected tab.  It seems to only work if I click the same tab twice.  I've tried setting the selected tab in the tabclick event and in the page_load event to to avail.  Does anyone have any ideas?
     
    Here is my code, including the tab.selected property in the event.  The functionality is the same with or without that line.

    <telerik:RadTabStrip ID="RadTabStrip2" runat="server" 
         DataSourceID="SqlDataSource5" DataTextField="proj_no" 
         ontabclick="RadTabStrip2_TabClick">  
    </telerik:RadTabStrip> 
     
        Protected Sub RadTabStrip2_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs)  
            FormView3.PageIndex = e.Tab.Index  
            e.Tab.Selected = True 
        End Sub 


    Thanks.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Jun 2010 Link to this post

    Hello Brian,

    Actually the tab should be selected when clicked without manually setting its Selected property.  Can you send us a simple page so that we can investigate the reasons for this issue? You should open a support ticket and send us the file there. Thanks.

    Best wishes,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian
    Brian avatar
    9 posts
    Member since:
    Dec 2007

    Posted 25 Jun 2010 Link to this post

    Thanks.  Entered ticket 322652.
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 28 Jun 2010 Link to this post

    Hello Brian,

    Thank you, I'll review the ticket.

    Kind regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Patrick Stovall
    Patrick Stovall avatar
    22 posts
    Member since:
    Jan 2008

    Posted 22 Jul 2010 Link to this post

    Has there been a resolution to this?

    I am also having issues of having to click a tab twice to get it to work. 

    Thanks.
  7. Brian
    Brian avatar
    9 posts
    Member since:
    Dec 2007

    Posted 22 Jul 2010 Link to this post

    Got the following from Telerik.

    The problem is that when the page index is changed, the tabstrip is rebinded and loses its selected index. I suggest you save it manually in the viewstate and set it in DataBound event. I've attached the modified page to demonstrate the approach (I use different datasource).

    Greetings,
    Yana
    the Telerik team

    Here's some of the code he sent.

    Imports System.Data
    Imports Telerik.Web.UI
      
    Partial Class masteroverviewVB
        Inherits System.Web.UI.Page
      
      
        Protected Sub masteroverview_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                If FormView3.TopPagerRow IsNot Nothing Then
                    Dim thisTabStrip As RadTabStrip = TryCast(FormView3.TopPagerRow.FindControl("RadTabStrip2"), RadTabStrip)
                    If thisTabStrip IsNot Nothing Then
                        thisTabStrip.SelectedIndex = 0
                    End If
                End If
            End If
      
        End Sub
      
        Protected Sub RadTabStrip2_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs)
            FormView3.PageIndex = e.Tab.Index
            ViewState("selectedTab") = e.Tab.Index
      
        End Sub
      
        Protected Sub RadTabStrip2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
            TryCast(sender, RadTabStrip).SelectedIndex = ViewState("selectedTab")
      
        End Sub
    End Class
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017