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

Find tabstrip from grid control

3 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lakmal
Top achievements
Rank 2
lakmal asked on 04 Nov 2009, 06:52 AM
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








3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Nov 2009, 07:42 AM
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.
0
lakmal
Top achievements
Rank 2
answered on 04 Nov 2009, 09:37 AM
Hi,

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

lakmal
0
Princy
Top achievements
Rank 2
answered on 04 Nov 2009, 10:06 AM
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.
Tags
Grid
Asked by
lakmal
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
lakmal
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or