Find tabstrip from grid control

4 posts, 0 answers
  1. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 04 Nov 2009 Link to this post

    Hi

    I have rad grid. Inside grid i have tabstrip. I want use findcontrol method in ItemCommand event . I do like below buy its not working

    my tab strip
     <NestedViewTemplate>
                        <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
            
                          <telerik:radtabstrip ID="RadTabStrip1" runat="server" SelectedIndex="0" AutoPostBack="true" OnClientTabSelecting="OnSelecting"
                            MultiPageID="RadMultiPage1" Skin="Web20">
                            <Tabs>
                     

     GridDataItem nestedItem = (GridDataItem)e.Item;
                ViewState["CurTab"] = ((RadTabStrip)nestedItem.FindControl("RadTabStrip1")).SelectedIndex;
             

    This method not working. So i try below method it also not working

     GridNestedViewItem nesteditem = (GridNestedViewItem)e.Item;
    ViewState["CurTab"] = ((RadTabStrip)nestedItem.FindControl("RadTabStrip1")).SelectedIndex;

    How can i find tabstrip?

    krds
    lakmal








  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Nov 2009 Link to this post

    Hi Lakmal,

    I am not sure about how to invoking the ItemCommand event and want to access the NestedViewItem. You can try the following code snippet in order to access the RadTabStrips in NestedViewTemplate.

    CS:
     
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
        foreach( GridNestedViewItem item in RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)) 
        { 
            RadTabStrip TabStrip = (RadTabStrip) item.FindControl("RadTabStrip1"); 
        } 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 04 Nov 2009 Link to this post

    Hi,

    I want take current expanded tabstrip. Not all the tabstrip. , How can i take current one

    lakmal
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Nov 2009 Link to this post

    Hello Lakmal,

    Try the following code for accessing the RadTabStrip placed in NestedViewTemplate on expanding the item.

    C#:
     
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
        if (e.CommandName == RadGrid.ExpandCollapseCommandName) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            GridNestedViewItem nestedItem = (GridNestedViewItem)item.ChildItem; 
            RadTabStrip TabStrip = (RadTabStrip)nestedItem.FindControl("RadTabStrip1"); 
        } 

    Thanks,
    Princy.
Back to Top