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

RadTabIsuue

1 Answer 6 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sudhakar
Top achievements
Rank 1
Sudhakar asked on 28 Aug 2014, 07:13 AM
Hi,

I have a issue in displaying label values when i click on a tab inside a radgrid.
please find the aspx and aspx.cs files

aspx file

<telerik:RadGrid ID="LoadingRadGrid" OnItemDataBound="LoadingRadGridFormat_OnItemDataBound"
                            runat="server" AutoGenerateColumns="false" CssClass="TransferGridPanel" Height="233px"
                            Width="475px" >
                            <MasterTableView ShowHeadersWhenNoRecords="true">
                           
                                <NestedViewTemplate>
                                
                                    <telerik:RadTabStrip runat="server" ID="LoadTabStip" MultiPageID="LoadMultipage"
                                        SelectedIndex="0" OnTabClick="LoadTabStip_TabClick" Orientation="HorizontalTop">
                                        <Tabs runat="server">
                                            <telerik:RadTab runat="server" Text="Details" PageViewID="RadPageViewDetails">
                                            </telerik:RadTab>
                                            <telerik:RadTab runat="server" Text="Compartments" PageViewID="RadPageViewCompartments">
                                            </telerik:RadTab>
                                            <telerik:RadTab runat="server" Text="Products" PageViewID="RadPageViewProducts">
                                            </telerik:RadTab>
                                        </Tabs>
                                    </telerik:RadTabStrip>
                                    <telerik:RadMultiPage runat="server" ID="LoadMultipage" SelectedIndex="0" RenderSelectedPageOnly="false">
                                   
                                        <telerik:RadPageView runat="server" ID="RadPageViewDetails">
                                       
                                            <div class="contactWrap">
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td>                                                                                                               
                                                           <asp:Label ID="lbl_TerminalId" runat="server" Text='Terminal Id'></asp:Label>  
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="lbl_TerminalName" runat="server" Text='TerminalName'></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </telerik:RadPageView>
                                        <telerik:RadPageView runat="server" ID="RadPageViewCompartments">
                                       
                                            <telerik:RadGrid ID="LoadTabRadGrid" runat="server" AutoGenerateColumns="false" CssClass="TransferGridPanel"
                                                Height="233px" Width="475px" >
                                                <MasterTableView ShowHeadersWhenNoRecords="true">                                               
                                                    <Columns>
                                                        <telerik:GridBoundColumn UniqueName="CompNo" DataField="CompartmentIndex">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="PlannedLoadProd" DataField="PlannedProductName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="ActualLoadProd" DataField="ActualProductName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="PlannedLoadQty" DataField="PlannedQuantity">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="ActualLoadQty" DataField="ActualQuantity">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                </MasterTableView>
                                            </telerik:RadGrid>
                                           
                                        </telerik:RadPageView>
                                    </telerik:RadMultiPage>
                                 
                                </NestedViewTemplate>
                               
                                <Columns>
                                    <telerik:GridBoundColumn UniqueName="LoadId" DataField="Loading_ID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="TerminalId" DataField="Plant_ID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="TerminalName" DataField="TerminalName">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="LoadingStartTime" DataField="LoadingStartTime">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="LoadingEndTime" DataField="LoadingEndTime">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>
                                <Scrolling AllowScroll="true" />
                            </ClientSettings>
                        </telerik:RadGrid>


aspx.cs file

protected void LoadTabStip_TabClick(object sender, RadTabStripEventArgs e)
    {
           
        string selectedtabindex = e.Tab.Text;
        Int64 shipmentID = Convert.ToInt64(ShiftTreeView.SelectedNode.Value);
        switch (selectedtabindex)
        {
            case "Details":
                {
                                        break;
                }
            case "Compartments":
                {
                    RadPageView page = (RadPageView)e.Tab.PageView;
                    RadGrid grdLoad = (RadGrid)page.FindControl("LoadTabRadGrid");                            
                    List<LoadingDetailEntity> loadingTabListinstance = new List<LoadingDetailEntity>();
                    loadingTabListinstance = loadingDetailManager.GetLoadingDetailListByShipmentId(shipmentID);
                    grdLoad.DataSource = loadingTabListinstance;
                    grdLoad.DataBind();
                  
                    //e.Tab.Controls.Add(grdLoad);
                    break;
                }
            case "Products":
                {
                    break;
                }
        }
    }

What to write in the Case:"details" section to get the required values.please find the attached file.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 28 Aug 2014, 07:34 AM
Hi Sudhakar,

Please try the following code snippet :

C#:
case "Details":
 {  
    RadPageView page = (RadPageView)e.Tab.PageView; 
    Label lblTerminalId = (Label)page.FindControl("lbl_TerminalId"); 
    lblTerminalId.Text = "Your Text";        //Bind data       
    break;
 }

Thanks,
Princy
Tags
Grid
Asked by
Sudhakar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or