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

Gradgrid and PageView with Rad controls

5 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thabiso
Top achievements
Rank 1
Thabiso asked on 21 Jan 2011, 10:00 AM
Hi,

i have a  link button in a radgrid control. when you click the link button(details) of a specific row in radgrid, it should display that rows' data to a radpageview with radtextboxes as outputs for the selected row.

Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jan 2011, 10:37 AM
Hello Thabiso,

Check out the following code snippet which I have tried in my application for similar scenario. Hope this helps.

ASPX:
<telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSource1">
   <MasterTableView>
          <Columns>
            <telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" Text="Button"
                    CommandName="ShowDetail" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Visible="false">
    <telerik:RadPageView ID="Pageview1" runat="server">
        <telerik:RadTextBox ID="RadTextBox1" runat="server">
        </telerik:RadTextBox>
     </telerik:RadPageView>
</telerik:RadMultiPage>

C#:
protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
   {
       if (e.CommandName == "ShowDetail")
       {
           GridDataItem item = (GridDataItem)e.Item;
           RadMultiPage1.Visible = true;
           RadTextBox1.Text = item["FirstName"].Text;//display corresponding details
         }
   }

Thanks,
Princy.
0
Thabiso
Top achievements
Rank 1
answered on 21 Jan 2011, 02:39 PM
Hi Pricy,

Thanks for the snippet, but I'm still having difficulties displaying the data, would it make a difference if Ive used Entity Framework?
Here is my code snippet:
ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="CostingTafiffMasterDEMO._default" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head id="Head1" runat="server">
    <title>Tariff Master</title>
    <style type="text/css">
        .style20
        {
            width: 193px;
        }
        .style21
        {
            width: 193px;
            height: 24px;
        }
        .style24
        {
            height: 24px;
            width: 100px;
        }
        .style25
        {
            width: 100px;
        }
        .style28
        {
            width: 189px;
        }
        .style29
        {
            height: 24px;
            width: 135px;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">
      
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="server">
  
    </telerik:RadStyleSheetManager>
  
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"/>
    <%--<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
        <script type="text/javascript">
        function SelectMyTab(sender, eventArgs)
        {
            var MultiPageID = sender.get_multiPageID();
            var tab = eventArgs.get_tab();
            sender.set_multiPageID(null);
            tab.select();
        }
  
        function UnSelectMyTab(e)
        {
            var tabStrip = $find('<%= RadTabStrip1.ClientID%>');
            if (!tabStrip) return;
            var destElement = e.relatedTarget || e.toElement;
            if ($telerik.isDescendant(tabStrip.get_element(), destElement))
                return;
            var initialTab = tabStrip.findTabByText(tabStrip.get_attributes().getAttribute("InitialTab"));
            initialTab.unselect();
            initialTab.selectParents;
        }
  
         
              
        </script>
    </telerik:RadCodeBlock>--%>
     
       
    <div>
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
       <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                                    </UpdatedControls>
              
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID ="RadGrid1">
            <UpdatedControls>
            </UpdatedControls>
             </telerik:AjaxSetting>
       </AjaxSettings>
    </telerik:RadAjaxManager>
       
  
      <telerik:RadToolBar ID="RadToolBar1" Runat="server" Skin="Web20">
        <Items>
            <telerik:RadToolBarDropDown runat="server" Text="Master">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="Jobs">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Job Progress">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Plant">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Planr BT's">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Plant Replace">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Tariff">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Bill of Quantities">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Control">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarDropDown runat="server" Text="Transactions">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="Time Sheets">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Vehicle&Plant">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Fuel">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Service">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Journal">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Materials">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Idle">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Short">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Pump">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="CShort">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarDropDown runat="server" Text="Process">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="Calculate">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Costing Reports">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Utilisation">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Vehicle&Plant">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Miscellaneous">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Adjustments">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarDropDown runat="server" Text="Enquire">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="JobExpendToDate">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Year Journals">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Costing Summary">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Plant">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Log of Changes">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarDropDown runat="server" Text="Files">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="Select File">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="File Maintainance">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Create New Year">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarDropDown runat="server" Text="Securities">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="Windows95">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Windows98">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="CL File Copy">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="CL File Restore">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarButton runat="server" Text="Change PSW">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Text="Restore PSW">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarDropDown runat="server" Text="Help">
                <Buttons>
                    <telerik:RadToolBarButton runat="server" Text="About">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Contents">
                    </telerik:RadToolBarButton>
                </Buttons>
            </telerik:RadToolBarDropDown>
            <telerik:RadToolBarButton runat="server" Text="Quit">
            </telerik:RadToolBarButton>
        </Items>
    </telerik:RadToolBar>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" 
        MultiPageID="RadMultiPage1" SelectedIndex="0">
        <Tabs>
            <telerik:RadTab runat="server" Selected="True" Text="Master" 
                PageViewID="RadPageView1">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Jobs" PageViewID="RadPageView2"
                     Selected="True">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Progress" PageViewID="RadPageView3">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Plant" PageViewID="RadPageView4">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Plant BT" PageViewID="RadPageView5">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Tariff" PageViewID="RadPageView6" >
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Bill of Qualities" PageViewID="RadPageView7">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Transactions">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Time Sheets">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Vehicle">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="WShop">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Fuel">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Services">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Journals">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Material">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Idle">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Short">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Processing">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Caculate">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Reports">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Utilisation">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Vehicle&Plant">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Miscellaneous">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Adjustments">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Enquiries">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Job ExpendTD">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Year Journals">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Summary">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Plant">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTab>
        </Tabs>
        </telerik:RadTabStrip>
  
<telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" Skin="Web20" />
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Visible="true">
        <telerik:RadPageView ID="RadPageView1" runat="server">
             <h3 class="title">Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server">
             <h3 class="title">No code behind for now. Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView3" runat="server">
             <h3 class="title">No code behind for now. Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView4" runat="server">
             <h3 class="title">No code behind for now. Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView5" runat="server">
             <h3 class="title">No code behind for now. Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView6" runat="server">
                       <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" 
             AllowSorting="True" AutoGenerateColumns="False" GridLines="Horizontal" 
             onneeddatasource="RadGrid1_NeedDataSource"
             onupdatecommand="RadGrid1_UpdateCommand" AllowAutomaticInserts="True" 
             AllowAutomaticUpdates="True" ondeletecommand="RadGrid1_DeleteCommand" 
             oninsertcommand="RadGrid1_InsertCommand" Skin="Web20" AllowFilteringByColumn="True">
            <ClientSettings EnablePostBackOnRowClick="True">
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="TeriffCode"
         AllowAutomaticDeletes="True" ShowFooter="True">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
  
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
  
    <Columns>
    <%--<telerik:GridEditCommandColumn  ButtonType="LinkButton" EditText="Detail"  >
            </telerik:GridEditCommandColumn>--%>
        <telerik:GridTemplateColumn>
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" Text="Detail" CommandName="showDetail" />
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="TariffType" 
            FilterControlAltText="Filter TariffType column" HeaderText="Tariff" 
            UniqueName="TariffType">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TeriffCode" 
            FilterControlAltText="Filter TeriffCode column" HeaderText="Tariff Code" 
            UniqueName="TeriffCode">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="KilometerApplication " 
            FilterControlAltText="Filter KilometerApplication column" 
            HeaderText="Kilo Application" UniqueName="KilometerApplication">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField=" AllocationVote" 
            FilterControlAltText="Filter AllocationVote column" 
            HeaderText="Allocation Vote" UniqueName="AllocationVote">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreditVoteAccount" 
            FilterControlAltText="Filter CreditVoteAccount column" 
            HeaderText="Credit Vote/Acc" UniqueName="CreditVoteAccount">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Status" 
            FilterControlAltText="Filter Status column" HeaderText="Status" 
            UniqueName="Status">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField=" Department" 
            FilterControlAltText="Filter Department column" HeaderText="Department" 
            UniqueName="Department">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Section" 
            FilterControlAltText="Filter Section column" HeaderText="Section" 
            UniqueName="Section">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TariffGroup" 
            FilterControlAltText="Filter TariffGroup column" HeaderText="Tariff Group" 
            UniqueName="TariffGroup">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" 
            FilterControlAltText="Filter Description column" HeaderText="Description" 
            UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="BudUtilHourYear" 
            FilterControlAltText="Filter BudUtilHourYear column" 
            HeaderText="Budget Utility Hours/Year" UniqueName="BudUtilHourYear">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MMHoursWorked" 
            FilterControlAltText="Filter MMHoursWorked column" HeaderText="MM Hours Worked" 
            UniqueName="MMHoursWorked">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StdHoursPerDay" 
            FilterControlAltText="Filter StdHoursPerDay column" 
            HeaderText="Standard Hours/Day" UniqueName="StdHoursPerDay">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SubSection" 
            FilterControlAltText="Filter SubSection column" HeaderText="SubSection" 
            UniqueName="SubSection">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ClockStation" 
            FilterControlAltText="Filter ClockStation column" HeaderText="Clock Station" 
            UniqueName="ClockStation">
        </telerik:GridBoundColumn>
          
    </Columns>
  
<EditFormSettings  >
<EditColumn  FilterControlAltText="Filter EditCommandColumn column"  >
</EditColumn>
<FormTemplate>
</FormTemplate>
</EditFormSettings>
  
</MasterTableView>
  
<FilterMenu EnableImageSprites="False"></FilterMenu>
  
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
            </telerik:RadGrid>
  
             <table ID="tblDetails" runat="server" cellpadding="0" cellspacing="0" 
                style=" margin-left:0px; height: 253px;" visible="true">
                <tr>
                    <td align="right" class="style24" style="text-align: right; ">
                        <asp:Label ID="lblTariffType" runat="server" BackColor="Transparent" 
                            Text="Tariff Type"></asp:Label>
                           
                    </td>
                    <td class="style21">
                        <telerik:RadTextBox ID="txtTariffType" runat="server" CssClass="clsTextBox" 
                            Width="140px">
                        </telerik:RadTextBox>
                    </td>
                    <td class="style29" style="text-align: right;">
                        <asp:Label ID="lblBudgUtil" runat="server" Text="Budget Utility/Year"></asp:Label>
                           
                    </td>
                    <td class="style28">
                        <telerik:RadTextBox ID="txtBudgUtil" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style25" style="text-align: right; ">
                        <asp:Label ID="lblTariffCode" runat="server" BackColor="Transparent" 
                            Text="Tariff Code"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtTariffCode" runat="server" CssClass="clsTextBox" 
                            Width="140px">
                        </telerik:RadTextBox>
                    </td>
                    <td class="style29" style="text-align: right;">
                        <asp:Label ID="lblMMHoursWorked" runat="server" Text="Hours/MM"></asp:Label>
                           
                    </td>
                    <td class="style28">
                        <telerik:RadTextBox ID="txtMMHoursWorked" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style25" style="text-align: right; ">
                        <asp:Label ID="lblKmAppl" runat="server" BackColor="Transparent" 
                            Text="Km Application"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtKmAppl" runat="server" CssClass="clsTextBox" 
                            Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style25" style="text-align: right; ">
                        <asp:Label ID="lbAllocVote" runat="server" BackColor="Transparent" 
                            Text="Account/Vote"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtAllocVote" runat="server" CssClass="clsTextBox" 
                            Width="140px">
                        </telerik:RadTextBox>
                    </td>
                    <td class="style29" style="text-align: right;">
                        <asp:Label ID="lblStdHoursPerDay" runat="server" Text="Std. Hours/Day"></asp:Label>
                           
                    </td>
                    <td class="style28">
                        <telerik:RadTextBox ID="txtStdHoursPerDay" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style25" style="text-align: right; ">
                        <asp:Label ID="lblCreditVoteAcc" runat="server" BackColor="Transparent" 
                            Text="Vote Number"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtCreditVoteAcc" runat="server" AutoPostBack="True" 
                            Height="20px" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                    <td class="style29" style="text-align: right;">
                        <asp:Label ID="lblSubSection" runat="server" Text="SubSection"></asp:Label>
                           
                    </td>
                    <td class="style28">
                        <telerik:RadTextBox ID="txtSubSection" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style25" style="text-align: right; ">
                        <asp:Label ID="lblStatus" runat="server" BackColor="Transparent" Text="Status"></asp:Label>
                           
                    </td>
                    <td class="style21">
                        <telerik:RadTextBox ID="txtStatus" runat="server" AutoPostBack="True" 
                            Height="20px" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                    <td class="style29" style="text-align: right;">
                        <asp:Label ID="lblClockStation" runat="server" Text="Clock Station"></asp:Label>
                           
                    </td>
                    <td class="style28">
                        <telerik:RadTextBox ID="txtClockStation" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style25" style="text-align: right;">
                        <asp:Label ID="lblDepartment" runat="server" Text="Department"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtDepartment" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style25" style="text-align: right;">
                        <asp:Label ID="lblSection" runat="server" Text="Section"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtSection" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style25" style="text-align: right;">
                        <asp:Label ID="lblTariffGroup" runat="server" Text="Tariff Group"></asp:Label>
                         </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtTariffGroup" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style25" style="text-align: right;">
                        <asp:Label ID="lblDescription" runat="server" Text="Description"></asp:Label>
                           
                    </td>
                    <td class="style20">
                        <telerik:RadTextBox ID="txtDescription" runat="server" CssClass="clsTextBox" 
                            MaxLength="50" Width="140px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
            </table>
</telerik:RadPageView>
  
  
        <telerik:RadPageView ID="RadPageView7" runat="server">
            <h3 class="title">
                No code behind for now. Please Select the Tariff's tab.</h3>
        </telerik:RadPageView>
  
  
    </telerik:RadMultiPage>
  
    </div>
      
       </form>
</body>
</html>

CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Collections;
  
namespace CostingTafiffMasterDEMO
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadTabStrip1.Attributes["InitialTab"] = RadTabStrip1.InnermostSelectedTab.Text;
                             
        }
  
        
  
        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            FMSTestingService serv = new FMSTestingService();
            List<CLTariffMasterDetail> Acc= serv.getAccounts();
            RadGrid1.DataSource = Acc;
  
        }
  
        protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            var Teriff = item.GetDataKeyValue("TeriffCode").ToString();
            CLTariffMasterDetail temp = new CLTariffMasterDetail();
            temp.TeriffCode = Teriff;
            item.UpdateValues(temp);
  
            FMSTestingService serv = new FMSTestingService();
            serv.updateAccount(temp);
  
        }
  
        protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            Hashtable values = new Hashtable();
            item.ExtractValues(values);
            CLTariffMasterDetail a = new CLTariffMasterDetail();
            item.UpdateValues(a);
  
            FMSTestingService serv = new FMSTestingService();
            serv.addNewAccount(a);
  
        }
  
        protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
        {
  
            int Code = int.Parse((e.Item as GridDataItem).GetDataKeyValue("TeriffCode").ToString());
            FMSTestingService serv = new FMSTestingService();
            serv.deleteAccount(Code);
        }
  
           protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "showDetail")
            {
                GridDataItem item = (GridDataItem)e.Item;
                RadMultiPage1.Visible = true;
                txtTariffType.Text = item["TariffType"].Text;
                txtBudgUtil.Text = item["BudUtilHourYear"].Text;
                txtTariffCode.Text = item["TeriffCode"].Text;
                txtMMHoursWorked.Text = item["MMHoursWorked"].Text;
                txtKmAppl.Text = item["KilometerApplication"].Text;
                txtAllocVote.Text = item["AllocationVote"].Text;
                txtStdHoursPerDay.Text = item["StdHoursPerDay"].Text;
                txtCreditVoteAcc.Text = item["CreditVoteAccount"].Text;
                txtSubSection.Text = item["SubSection"].Text;
                txtStatus.Text = item["Status"].Text;
                txtClockStation.Text = item["ClockStation"].Text;
                txtDepartment.Text = item["Department"].Text;
                txtSection.Text = item["Section"].Text;
                txtTariffGroup.Text = item["TariffGroup"].Text;
                txtDescription.Text = item["Description"].Text;
  
            }
        }
  
    }
}

Once again thanks in advance
0
Princy
Top achievements
Rank 2
answered on 24 Jan 2011, 10:59 AM
Hello Thabiso,

Since RadGrid update controls in RadMultiPage, you need to add that in AjaxSettings of RadAjaxManager. Make the following modification i AjaxSettings and check whether it works now.

ASPX:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Thanks,
Princy.
0
Thabiso
Top achievements
Rank 1
answered on 25 Jan 2011, 09:59 AM
Hi Prncy,

Sorry to inform you it's still wont show the data...
This is so fustrating, ive been trying to find the solution for the past 3 working days with no avail.
If you have more ideas I would really appreciate it.

Thanks
0
Maria Ilieva
Telerik team
answered on 28 Jan 2011, 09:24 AM
Hello Thabiso,

Could you please try to wrap all the controls (RadTabStrip, RadMultiPage, RadGrid) into single RadAjaxPanel control and verify if this works.

Greetings,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Thabiso
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Thabiso
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or