+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Search textbox in tab

Search textbox in tab

4 posts, 0 answered
  1. Sharon
    Sharon avatar
    17 posts
    Registered:
    06 Feb 2009
    25 Aug 2009
    Link to this post
    Hello,

    I am using Telerik Radtabstrip in my site. One of the tab in the radtabstrip should have a search field. I am able to load textbox and button into the tab... but it is not working. Could you please help me on this.

    Sincerely,
    Sharon
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    25 Aug 2009
    Link to this post
    Hello Sharon,

    Could you tell us what exacting is not working and do you use our search box control or you have a custom one?

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Sharon
    Sharon avatar
    17 posts
    Registered:
    06 Feb 2009
    25 Aug 2009
    Link to this post
    Hi Ivan,
     I have a tab structure like this

    Tab1 Tab2 Tab3 Tab4 Tab5
    Tab1.1 Tab1.2 Tab1.3 Tab1.4
    Tab1.1.1
    Tab1.1.2
    Tab1.1.3
    Tab1.1.4

    The tab structure is created dynamicaly.This is what I'm trying to achieve, In Tab5 I need to place a textbox and button as a search control. I'm able to load the control but i'm not able to make it functional as i'm not able to read the text that is input in the textbox.

    Please help me in this.

    Thanks a lot,
    Sharon.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    25 Aug 2009
    Link to this post
    Hello Sharon,

    You can use recursion or get reference to the tab5 template.

    <telerik:RadTabStrip SelectedIndex="0" ID="tabStrip1" Skin="Vista" runat="server" > 
     <Tabs> 
        <telerik:RadTab Text="Tab1" ></telerik:RadTab> 
        <telerik:RadTab Text="Tab2"></telerik:RadTab> 
        <telerik:RadTab Text="Tab3" > 
            <TabTemplate> 
                <asp:TextBox ID="serchBox1" runat="server"></asp:TextBox> 
                <asp:button ID="searchButton1" runat="server" Text="search" /> 
            </TabTemplate> 
        </telerik:RadTab> 
     </Tabs> 
     </telerik:RadTabStrip> 



     ... 
           .... 
     
        TextBox tb = FindControlRecursive(tabStrip1, "serchBox1"as TextBox; 
         
        // do something 
            ... 
              .... 
        private Control FindControlRecursive(Control root, string id) 
        { 
            if (root.ID == id) 
            { 
                return root; 
            } 
     
            foreach (Control c in root.Controls) 
            { 
                Control t = FindControlRecursive(c, id); 
                if (t != null
                { 
                    return t; 
                } 
            } 
     
            return null
        }  

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered