Please find below code :
aspx:
<asp:UpdatePanel ID ="upnl" runat ="server" >
<ContentTemplate>
<telerik:RadGrid RenderMode="Lightweight" ID="SupplierPackageDetails" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
PageSize="7" AllowSorting="false" AllowMultiRowSelection="False" AllowPaging="False"
OnDetailTableDataBind="SupplierPackageDetails_DetailTableDataBind"
OnPreRender="SupplierPackageDetails_PreRender"
OnNeedDataSource="SupplierPackageDetails_NeedDataSource"
OnItemDataBound="SupplierPackageDetails_ItemDataBound"
RetainExpandStateOnRebind="true"
AllowAutomaticInserts ="false"
EnableGroupsExpandAll="true" ClientSettings-EnablePostBackOnRowClick="false" CssClass="RadGridCustomClass" OnItemCommand="SupplierPackageDetails_ItemCommand">
<PagerStyle Mode="NumericPages"></PagerStyle>
<HeaderStyle CssClass="HeaderStyle"></HeaderStyle>
<ClientSettings EnablePostBackOnRowClick="false">
</ClientSettings>
<MasterTableView DataKeyNames="LineItemId" AllowAutomaticInserts ="false" AllowMultiColumnSorting="false" HierarchyLoadMode="Client" HierarchyDefaultExpanded="true" RetainExpandStateOnRebind="true">
<DetailTables>
<telerik:GridTableView DataKeyNames="LineItemId,OrderPackageLineItemId" ExpandCollapseColumn-Display="false" RetainExpandStateOnRebind="true" Name="Performancestep" Width="100%" AlternatingItemStyle-BackColor="White" EditMode="EditForms">
<HeaderStyle CssClass="InnerHeaderStyle"></HeaderStyle>
<%--OIT-1857 Show configuration information in order details like print page for Update Supplier screen--%>
<DetailTables>
<telerik:GridTableView EnableHierarchyExpandAll="true" ExpandCollapseColumn-Display="false" HierarchyDefaultExpanded="true" RetainExpandStateOnRebind="true" DataKeyNames="Config" Width="100%" Name="ConfigDetails"
AutoGenerateColumns="false" runat="server">
<Columns>
<telerik:GridBoundColumn SortExpression="Config" HeaderText="Configuration Details" HeaderButtonType="TextButton"
DataField="Config" UniqueName="Config">
</telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<%--OIT-1857--%>
<Columns>
<%-- <telerik:GridExpandColumn UniqueName="ExapandColumn" Visible="false"></telerik:GridExpandColumn>--%>
<telerik:GridBoundColumn HeaderButtonType="TextButton" HeaderText="Product Id"
DataField="PerformanceStepId" HeaderStyle-Width="95px" ItemStyle-Width="95px"
HeaderStyle-Font-Bold="true" UniqueName="PerformanceStepId">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Title" HeaderButtonType="TextButton"
DataField="Title" HeaderStyle-Width="200px" ItemStyle-Width="200px"
HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right"
HeaderText="OneTime Cost" HeaderStyle-Width="80px" ItemStyle-Width="80px"
HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# PresentationUtils.FormatCurrency((Decimal)Eval("OneTimeCost")) %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right"
HeaderText="Monthly Cost" HeaderStyle-Width="80px" ItemStyle-Width="80px"
HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# PresentationUtils.FormatCurrency((Decimal)Eval("MonthlyCost")) %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<%--OIT-1754 Changes to Update Supplier Status screen--%>
<telerik:GridBoundColumn HeaderButtonType="TextButton" HeaderText="Part No."
DataField="SupplierPartNo" HeaderStyle-Width="95px" ItemStyle-Width="95px"
HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<%-- <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right"
HeaderText="Part Number" HeaderStyle-Width="80px" ItemStyle-Width="80px"
HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("SupplierPartNo") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridImageColumn HeaderText="View Configuration" HeaderStyle-Width="90px"
HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center">
</telerik:GridImageColumn>--%>
<telerik:GridBoundColumn HeaderText="Status" HeaderButtonType="TextButton" HeaderStyle-Font-Bold="true"
DataField="ConfigurableStatusDescription">
</telerik:GridBoundColumn>
<telerik:GridImageColumn HeaderText="History" HeaderStyle-Width="90px" HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center"></telerik:GridImageColumn>
<telerik:GridBoundColumn HeaderButtonType="TextButton" HeaderText="Product Id"
DataField="LineItemId" HeaderStyle-Width="90px" ItemStyle-Width="90px" Display="false"
HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn UniqueName="GridEditCommandColumn" ButtonType="ImageButton" EditImageUrl="images/icon_edit.gif">
</telerik:GridEditCommandColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<%-- <asp:UpdatePanel ID ="updEdit" runat="server" UpdateMode ="Always" >
<ContentTemplate >--%>
<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse;">
<tr>
<td colspan="2">
<b>Select Supplier Status</b>
</td>
</tr>
<tr>
<td>Supplier Status:</td>
<td style="padding-bottom: 10px">
<asp:DropDownList ID="ddlSupplierStatus" runat="server">
<asp:ListItem Text="In Progress" Value="BOOKED"></asp:ListItem>
<asp:ListItem Text="Delivered" Value="DELIVERED"></asp:ListItem>
<asp:ListItem Text="Cancelled" Value="CANCELLED"></asp:ListItem>
<%--// LSHK1P - OIT-1856 New status in Update order status screen--%>
<asp:ListItem Text="Transferred" Value="TRANSFERRED"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<div style="float: left; width: 150px;">
Enter Comments :
</div>
</td>
<td>
<div style="float: left">
<asp:TextBox ID="txtCommentsforSupplier" TextMode="MultiLine" Width="400px" Height="100px" Enabled="true"
runat="server" MaxLength="800"></asp:TextBox>
</div>
</td>
</tr>
<tr>
<td></td>
<td>(max 800 characters)
</td>
<td colspan="3"></td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnSave" Text="Save"
runat="server" CommandName="Save" CausesValidation="False" ></asp:Button>
<%--<asp:UpdatePanel runat="server"><Triggers><asp:AsyncPostBackTrigger ControlID="btnSave"/></Triggers></asp:UpdatePanel>--%>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
<%-- </ContentTemplate>
<Triggers >
<asp:AsyncPostBackTrigger ControlID ="btnSave" EventName="Save" />
</Triggers>
</asp:UpdatePanel>--%>
</FormTemplate>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridBoundColumn HeaderText="Product Id" HeaderButtonType="TextButton"
DataField="PackageId" HeaderStyle-Width="80px" ItemStyle-Width="80px"
ItemStyle-BackColor="#e5e5e5" ItemStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Left" ItemStyle-BackColor="#e5e5e5"
HeaderText="Title" HeaderStyle-Width="175px" ItemStyle-Width="175px"
ItemStyle-BorderColor="#e5e5e5" HeaderStyle-Font-Bold="true">
<ItemTemplate>
<a id="pkgTitle" runat="server" style="font-weight: bold;" href='javascript:openBrWindowBig("PackageInCart_View.aspx?LineItem=<%# Eval("LineItemId") %>&Mode=<%= order%>&OrderGuid=<%=hdnOrderId.Value%>&UserId=<%=hdnUserId.Value%>&Released=<%=this.IsReleased %>","","")'>
<asp:Label ID="lblPackageTitle" CommandArgument='<%# Eval("LineItemId")%>' runat="server" Text='<%# Eval("Title") %>'></asp:Label>
</a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Quantity" HeaderButtonType="TextButton"
DataField="Quantity" HeaderStyle-Width="80px" ItemStyle-Width="80px"
ItemStyle-BackColor="#e5e5e5" HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#e5e5e5"
HeaderText="OneTime Cost" HeaderStyle-Width="100px" ItemStyle-Width="100px"
ItemStyle-BorderColor="#e5e5e5" HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# PresentationUtils.FormatCurrency((Decimal)Eval("OneTimeCost")) %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#e5e5e5"
HeaderText="Monthly Cost" HeaderStyle-Width="100px" ItemStyle-Width="100px"
ItemStyle-BorderColor="#e5e5e5" HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# PresentationUtils.FormatCurrency((Decimal)Eval("MonthlyCost")) %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-BackColor="#e5e5e5"
HeaderText="View Configuration" HeaderStyle-Width="90px" ItemStyle-Width="90px"
HeaderStyle-Font-Bold="true">
<ItemTemplate>
<%-- CR 5555 Config info for Pkg --%>
<asp:Image ID="imgPkgViewConfig" ImageUrl="images/icon_cog.gif" runat="server"
border="0" align="absmiddle" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</ContentTemplate>
<%-- <Triggers>
<asp:PostBackTrigger ControlID="btnSave" />
</Triggers>--%>
</asp:UpdatePanel>
C# code for save button which is inside edit template:
protected void SupplierPackageDetails_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "Save")
{
GridEditableItem editedItem = (GridEditableItem)((e.CommandSource) as Button).NamingContainer;
TextBox txtComment = (TextBox)editedItem.FindControl("txtCommentsforSupplier");
DropDownList ddlStatus = (DropDownList)editedItem.FindControl("ddlSupplierStatus");
string strComment = txtComment.Text;
string strPerformanceStepId = editedItem["PerformanceStepId"].Text;
string strSelectedStatus = ddlStatus.SelectedValue; //SelectedValue
string LineitemID = editedItem.GetDataKeyValue("LineItemId").ToString();
string OrderPackageLineItemId = editedItem.GetDataKeyValue("OrderPackageLineItemId").ToString();
List<PackageLineItem> objListofPackagesInOrder = (List<PackageLineItem>)ViewState["dsPackagesInOrder"];
orderDetails = (OrderInfo)ViewState["Orderdetails"];
if (objListofPackagesInOrder != null)
{
PerformanceStepLineItem performanceStepsLineItemTemp = objListofPackagesInOrder.FirstOrDefault(x => x.LineItemId == OrderPackageLineItemId).PerformanceStepInOrder.FirstOrDefault(y => y.LineItemId == LineitemID);
//if(nullorempty check) for 1709
if (!string.IsNullOrEmpty(strComment))
{
performanceStepsLineItemTemp.SupplierStatusDescription = strComment;
}
else { performanceStepsLineItemTemp.SupplierStatusDescription = ddlStatus.SelectedItem.Text; }
orderDetails.LoggedInUser = this.loggedInUser;
OrderService.HandleOrderRowItemEvent(orderDetails, PerformanceStepsEvent(strSelectedStatus), connection, performanceStepsLineItemTemp);
LoadData(true);
SupplierPackageDetails.MasterTableView.ClearEditItems();
//int countmain = SupplierPackageDetails.MasterTableView.Items.Count;
//for (int j = 0; j < countmain; j++)
//{
// int count = SupplierPackageDetails.MasterTableView.Items[j].ChildItem.NestedTableViews[0].Items.Count;
// for (int i = 0; i < count; i++)
// {
// SupplierPackageDetails.MasterTableView.Items[j].ChildItem.NestedTableViews[0].Items[i].Expanded = true;
// }
//}
}
}
}