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

Edit item after filters grid data

10 Answers 192 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chinna
Top achievements
Rank 1
chinna asked on 10 Dec 2009, 12:39 PM
Hi ,
In our application we are giving provision to user  Filter grid data  and Edit functionality but edit is not working correctly after applying the filters , grid set first row in edit instead of first row of filter data items. 
if any one implemented  like this ,  please let know me approach you followed . 

Koteswararao    

10 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Dec 2009, 03:38 PM
Hello Chinna,

Based on the provided information it is hard to determine what have caused the unexpected behavior.
Could you please send the problematic page code? I will check it out and try finding what could have wrong there.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
chinna
Top achievements
Rank 1
answered on 10 Dec 2009, 04:19 PM
Hi Pavilna , 
  I have  Grid with five columns and  have features Add/Edit/Delete and filters
Following steps to replicate issue    
  Step 1 : By entering filter value in one of the column  and selected Filter condition "Contain"
  Step2 : Grid filter the data and showed satified rows
  Step3 : Clicked on Edit button (its not customised, default grid feature) of Filter first Row 
  Step4 : Grid opened first row of initial data items in Edit mode instead filter data first row       
 
Please let me know still if you not clear on my problem
 
Thank you
Koteswararao
0
Pavlina
Telerik team
answered on 15 Dec 2009, 02:34 PM
Hi Chinna,

This is indeed a strange issue and unfortunately I am not able to replicate it in my local tests. Can you please verify that you are using the latest version 2009.3.1208 of RadControls for ASP.NET AJAX in your project and provide a live url where the problem can be seen? Thus I will do everything possible to provide an appropriate explanation/fix.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
chinna
Top achievements
Rank 1
answered on 15 Dec 2009, 03:28 PM
Thank you  Pavlina for getting back me on the issue. 
Currently we are using Telerik version 2009.1.527.  If possible i will create test application and send to you to replicate the issue  

Thank you
Koti
0
chinna
Top achievements
Rank 1
answered on 24 Feb 2010, 11:19 AM
Hi Pavlina,

Here is my Aspx code . Could you please a have look on my aspx  code and let me know if you find  any strange things.  

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="ConfigureCorrespondencePacketsByLOB.ascx.cs"

 

 

Inherits="FileOne.SystemWorks.Web.ConfigureCorrespondencePacketsByLOB" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<%

@ Register Src="~/Common/SystemMessageControl.ascx" TagName="SystemMessageControl"

 

 

TagPrefix="uc1" %>

 

<%

@ Import Namespace="FileOne.SystemWorks.Web" %>

 

<!--bof System Message -->

<

 

asp:Panel ID="SystemMessagePanelControl" runat="server" Visible="False"

 

 

meta:resourcekey="SystemMessagePanelControlResource1">

 

 

<div width="100%">

 

 

<uc1:SystemMessageControl ID="SystemMessageControl" runat="server" />

 

 

</div>

 

</

 

asp:Panel>

 

<!--eof System Message -->

<

 

telerik:RadGrid ID="radGridCorrespondencePackets" runat="server" ShowGroupPanel="True" AllowPaging="True" PageSize="50" PagerStyle-AlwaysVisible="False"

 

 

AutoGenerateColumns="False" AllowFilteringByColumn="True" AllowSorting="True" ShowStatusBar="True" Width="100%"

 

 

OnNeedDataSource="radGrid_NeedDataSource" OnItemDataBound="radGrid_ItemDataBound" OnItemCommand="radGrid_ItemCommand"

 

 

OnItemCreated="radGrid_ItemCreated" OnItemEvent="radGrid_ItemEvent" OnInsertCommand="radGrid_InsertCommand"

 

 

OnDetailTableDataBind="radGrid_DetailTableDataBind" OnUpdateCommand="radGrid_UpdateCommand" OnDeleteCommand="radGrid_DeleteCommand"

 

 

OnCancelCommand="radGrid_CancelCommand" OnPreRender="radGrid_PreRender" OnRowDrop="radGridCorrespondenceLiens_RowDrop"

 

 

OnSelectedIndexChanged="RadGrid_SelectedIndexChanged" GridLines="None" meta:resourcekey="radGridCorrespondencePacketsResource1">

 

 

<grouppanel id="SystemWorksStandardGridGroupPanel">

 

 

<PanelStyle Width="100%" Height="20px"/>

 

 

</grouppanel>

 

 

<validationsettings enablevalidation="true" validationgroup="ParentGrid" />

 

 

<clientsettings allowdragtogroup="False" allowkeyboardnavigation="true" clientevents-onkeypress="KeyPressed" allowrowsdragdrop="true"

 

 

enablepostbackonrowclick="true">

 

 

<ClientEvents OnKeyPress="KeyPressed"></ClientEvents>

 

 

<Selecting AllowRowSelect="true" />

 

 

</clientsettings>

 

 

<mastertableview commanditemdisplay="Top" autogeneratecolumns="False" editmode="InPlace" tablelayout="Fixed" allowfilteringbycolumn="true"

 

 

allowsorting="true" enablenorecordstemplate="true" filteritemstyle-width="10px" hierarchyloadmode="ServerOnDemand"

 

 

showheaderswhennorecords="true" name="CorrespondencePacketParent" allowautomaticinserts="false" datakeynames="CorrPacketID,CorrPacketName">

 

 

<FilterItemStyle Width="10px"></FilterItemStyle>

 

 

<CommandItemTemplate>

 

 

<table>

 

 

<tr>

 

 

<td align="center">

 

 

<asp:LinkButton ID="CopyComponent" runat="server" CommandName="Copy" CommandArgument="Copycomponent"

 

 

SkinID="swGridCopyCompLinkButton" Enabled="False" meta:resourcekey="CopyComponentResource1" />

 

 

</td>

 

 

<td></td>

 

 

<td>

 

 

<asp:LinkButton ID="PasteComponent" runat="server" CommandName="Paste" CommandArgument="Pastecomponent"

 

 

SkinID="swGridPasteCompLinkButton" Enabled="False" meta:resourcekey="PasteComponentResource1" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</CommandItemTemplate>

 

 

<ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" ItemStyle-Wrap="false" EditImageUrl="../Images/EditRecord.gif"

 

 

InsertImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateText="Update"

 

 

CancelText="Cancel" EditText="Edit" meta:resourcekey="GridEditCommandColumnResource2">

 

 

<HeaderStyle Width="40px"/>

 

 

<ItemStyle Wrap="False"></ItemStyle>

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrPacketID" DataField="CorrPacketID" Visible="false" AllowFiltering="false"

 

 

meta:resourcekey="GridBoundColumnResource5">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="CorrPacketName" DataField="CorrPacketName" Visible="true" AllowFiltering="true"

 

 

SortExpression="CorrPacketName" meta:resourcekey="GridTemplateColumnResource12">

 

 

<ItemTemplate>

 

<%

# Eval("CorrPacketName")%>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

<%

# Eval("CorrPacketName")%>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="ProcessingActnValue" Visible="true" AllowFiltering="true" DataField="ProcessingActnValue"

 

 

SortExpression="ProcessingActnValue" meta:resourcekey="GridTemplateColumnResource13">

 

 

<ItemTemplate>

 

<%

# Eval("ProcessingActnValue")%>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

<%

# Eval("ProcessingActnValue")%>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="LOBTypeValue" Visible="true" AllowFiltering="true" DataField="LOBTypeValue"

 

 

SortExpression="LOBTypeValue" meta:resourcekey="GridTemplateColumnResource14">

 

 

<ItemTemplate>

 

<%

# Eval("LOBTypeValue")%>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

<%

# Eval("LOBTypeValue")%>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="FilingTypeValue" Visible="true" AllowFiltering="true" DataField="FilingTypeValue"

 

 

SortExpression="FilingTypeValue" meta:resourcekey="GridTemplateColumnResource15">

 

 

<ItemTemplate>

 

<%

# Eval("FilingTypeValue")%>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

<%

# Eval("FilingTypeValue")%>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn UniqueName="IsAssocWithReturnValue" DataField="IsAssocWithReturn " Visible="false"

 

 

meta:resourcekey="GridBoundColumnResource6" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="IsAssocWithReturn" Visible="true" AllowFiltering="false" SortExpression="IsAssocWithReturn"

 

 

DataType="System.Boolean" meta:resourcekey="GridTemplateColumnResource16">

 

 

<HeaderStyle Width="100px"/>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="Associate" runat="server" Checked='<%# Eval("IsAssocWithReturn") %>' Enabled="False"

 

 

meta:resourcekey="AssociateResource1">

 

 

</asp:CheckBox>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<asp:CheckBox ID="AssociateCheck" runat="server" Checked='<%# Eval("IsAssocWithReturn") %>'

 

 

meta:resourcekey="AssociateCheckResource1" >

 

 

</asp:CheckBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<DetailTables>

 

 

<telerik:GridTableView AllowFilteringByColumn="false" AllowSorting="false" AutoGenerateColumns="false" EditMode="EditForms"

 

 

CommandItemDisplay="Top" Name="CorrespondencePacketChild" runat="server" Width="100%" DataKeyNames="CorrPacketDetailID,CorrPacketID"

 

 

meta:resourcekey="GridTableViewResource1" EditFormSettings-EditFormType="Template">

 

 

<EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

<CommandItemTemplate>

 

 

<div>

 

 

<asp:Label ID="LabelInfo" runat="server" CssClass="swChildGridHeaderText" meta:resourcekey="LabelInfoResource1"/>

 

 

</div>

 

 

<div style="float: left; text-align: right">

 

 

<asp:LinkButton ID="AddNewChildDoc" runat="server" CommandName="InitInsert" CommandArgument="AddNewPacketComponents"

 

 

SkinID="swGridAddNewLinkButton" meta:resourcekey="AddNewChildDocResource1" />

 

 

</div>

 

 

<div style="float: right; text-align: right">

 

 

<asp:LinkButton ID="RefreshGridLinkButton" runat="server" SkinID="swGridRefreshLinkButton" CommandName="refresh"

 

 

meta:resourcekey="RefreshGridLinkButtonResource1">

 

 

</asp:LinkButton>

 

 

</div>

 

 

<asp:ValidationSummary ID="ValidationSummaryChild" runat="server" EnableClientScript="False" DisplayMode="List"

 

 

SkinID="swGridValidationSummary" ValidationGroup="ChildGrid" meta:resourcekey="ValidationSummaryChildResource1" />

 

 

</CommandItemTemplate>

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn ItemStyle-Wrap="false" ButtonType="ImageButton" EditImageUrl="../Images/EditRecord.gif"

 

 

InsertImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateImageUrl="../Images/Office2007/16X16/saveHS.gif"

 

 

UniqueName="EditColumn" meta:resourcekey="GridEditCommandColumnResource1">

 

 

<HeaderStyle Width="40px"/>

 

 

<ItemStyle Wrap="False"></ItemStyle>

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../Images/DeleteRecord.gif" CommandName="Delete"

 

 

UniqueName="DeleteColumn" meta:resourcekey="GridButtonColumnResource1">

 

 

<HeaderStyle Width="20px"/>

 

 

</telerik:GridButtonColumn>

 

 

<telerik:GridBoundColumn UniqueName="CorrPacketID" DataField="CorrPacketID" Visible="false"

 

 

meta:resourcekey="GridBoundColumnResource1">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrPacketDetailID" DataField="CorrPacketDetailID" Visible="false"

 

 

meta:resourcekey="GridBoundColumnResource2">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Sequence" Visible="true" AllowFiltering="true" SortExpression="Sequence"

 

 

meta:resourcekey="GridTemplateColumnResource1">

 

 

<HeaderStyle Width="50px"/>

 

 

<ItemTemplate>

 

<%

# Eval("Sequence")%>

 

 

</ItemTemplate>

 

<%

-- <EditItemTemplate>

 

<%# Eval("Sequence")%>

</EditItemTemplate>

--

 

%>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="ComponentCategoryValue" DataField="ComponentCatValue"

 

 

Visible="false" meta:resourcekey="GridBoundColumnResource3">

 

 

</telerik:GridBoundColumn>

 

<%

--bof Add New DateRange Columns--%>

 

 

<telerik:GridBoundColumn UniqueName="DateRangeFrom" DataField="FromDate" SortExpression="FromDate"

 

 

meta:resourcekey="DateRangeFrom">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="DateRangeTo" DataField="ToDate" SortExpression="ToDate"

 

 

meta:resourcekey="DateRangeTo">

 

 

</telerik:GridBoundColumn>

 

<%

--eof Add New DateRange Columns--%>

 

 

 

<telerik:GridTemplateColumn UniqueName="ComponentCategoryID" DataField="ComponentCatValue" SortExpression="CompCategoryValue"

 

 

DataType="System.String" meta:resourcekey="GridTemplateColumnResource2">

 

 

<ItemTemplate>

 

<%

# Eval("ComponentCatValue")%>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrItemValue" DataField="CorrItemName" Visible="false"

 

 

meta:resourcekey="GridBoundColumnResource4">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="ComponentID" DataField="CorrItemName" meta:resourcekey="GridTemplateColumnResource3" >

 

 

<ItemTemplate>

 

<%

# Eval("CorrItemName")%>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="FulfillmentDocumentLabel" AllowFiltering="false"

 

 

meta:resourcekey="GridTemplateColumnResource4" >

 

 

<ItemTemplate>

 

 

<asp:Label ID="FulfillmentDocumentLabel" runat="server" Text='<%# Eval("DocumentLabel") %>'

 

 

meta:resourcekey="FulfillmentDocumentLabelResource1" >

 

 

</asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn UniqueName="CorrespondenceLabel" DataField="CorrespondenceLabel" SortExpression="CorrespondenceLabel"

 

 

meta:resourcekey="GridTemplateColumnResource5">

 

 

</telerik:GridBoundColumn>

 

 

<%

--<telerik:GridTemplateColumn UniqueName="CorrespondenceLabel" AllowFiltering="false" meta:resourcekey="GridTemplateColumnResource5" >

 

<ItemTemplate>

<asp:Label ID="CorrespondenceLabel" runat="server" Text='<%# Eval("CorrespondenceLabel") %>'

meta:resourcekey="CorrespondenceLabelResource1" >

</asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>--

 

%>

 

 

<telerik:GridTemplateColumn UniqueName="IsBurned" DataField="IsBurned" AllowFiltering="false" Display="false"

 

 

meta:resourcekey="GridTemplateColumnResource6" >

 

 

<HeaderStyle Width="170px" HorizontalAlign="center"/>

 

 

<HeaderTemplate>

 

 

<table frame="void" border="0" width="100%">

 

 

<tr>

 

 

<td colspan="3" align="center">

 

 

<asp:Label ID="ElectronicStampTitleLabel" runat="server" meta:resourcekey="ElectronicStampTitleResource"/>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td width="50px">

 

 

<asp:Label ID="ElectronicStampEnableLabel" runat="server" meta:resourcekey="ElectronicStampEnableResource"/>

 

 

</td>

 

 

<td width="50px">

 

 

<asp:Label ID="ElectronicStampWidthLabel" runat="server" meta:resourcekey="ElectronicStampWidthResource"/>

 

 

</td>

 

 

<td width="50px">

 

 

<asp:Label ID="ElectronicStampHeightLabel" runat="server" meta:resourcekey="ElectronicStampHeightResource"/>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<table frame="void" border="0" width="100%">

 

 

<tr>

 

 

<td width="50px" style="border-style: none">

 

 

<asp:CheckBox ID="chkBurn" runat="server" Checked='<%# Eval("IsBurned") %>' Enabled="False"

 

 

meta:resourcekey="chkBurnResource1" />

 

 

</td>

 

 

<td width="50px" style="border-style: none">

 

 

<asp:Label ID="StampXLabel" runat="server"

 

 

Text ='<%# Eval("ElecStampXCoordinate") %>'

 

 

meta:resourcekey="StampXLabelResource1" />

 

 

</td>

 

 

<td width="50px" style="border-style: none">

 

 

<asp:Label ID="StampYLabel" runat="server"

 

 

Text ='<%# Eval("ElecStampYCoordinate") %>'

 

 

meta:resourcekey="StampYLabelResource1" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Pages" DataField="Pages" AllowFiltering="false" Display="false"

 

 

meta:resourcekey="GridTemplateColumnResource7">

 

 

<ItemTemplate>

 

 

<asp:Label ID="Label1" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="Label1Resource1"/>

 

 

</ItemTemplate>

 

<%

-- <EditItemTemplate>

 

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="TextBox1Resource1"></asp:TextBox>

</EditItemTemplate>

--

 

%>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Copies" DataField="Copies" AllowFiltering="false"

 

 

meta:resourcekey="GridTemplateColumnResource8">

 

 

<HeaderStyle Width="70px"/>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblCopies" runat="server" Text='<%# Eval("Copies") %>' meta:resourcekey="lblCopiesResource1" ></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="IsPaperFiling" DataField="IsPaperFiling" AllowFiltering="false"

 

 

meta:resourcekey="GridTemplateColumnResource9" >

 

 

<HeaderStyle Width="50px"/>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="chkPaperFiling" runat="server" Checked='<%# Eval("IsPaperFiling") %>' Enabled="False"

 

 

meta:resourcekey="chkPaperFilingResource1" >

 

 

</asp:CheckBox>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="IsEFiling" DataField="IsEFiling" AllowFiltering="false"

 

 

meta:resourcekey="GridTemplateColumnResource10" >

 

 

<HeaderStyle Width="50px"/>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="chkEFiling" runat="server" Checked='<%# Eval("IsEFiling") %>' Enabled="False"

 

 

meta:resourcekey="chkEFilingResource1">

 

 

</asp:CheckBox>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="IsPublic" DataField="IsPublic" AllowFiltering="false"

 

 

meta:resourcekey="GridTemplateColumnResourcePublic" >

 

 

<HeaderStyle Width="50px"/>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="chkPublic" runat="server" Checked='<%# Eval("IsPublic") %>' Enabled="False"

 

 

meta:resourcekey="chkPublicResource">

 

 

</asp:CheckBox>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Pages" DataField="Pages" AllowFiltering="false" Display="false"

 

 

meta:resourcekey="GridTemplateColumnResource11">

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblPages" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="lblPagesResource1"/>

 

 

</ItemTemplate>

 

<%

-- <EditItemTemplate>

 

<asp:TextBox ID="txtPages" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="txtPagesResource1"></asp:TextBox>

</EditItemTemplate>--

 

%>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<EditFormSettings EditFormType="Template">

 

 

<EditColumn UniqueName="EditColumn">

 

 

</EditColumn>

 

 

<FormTemplate>

 

 

<div class="swGridAddEditOutterBorderDiv">

 

 

<div class="swGridAddEditInnerBorderDiv">

 

 

<div class="swGridAddEditWrapperDiv">

 

 

<div class="GridHeader_Office2007" style=" margin-left:10px;">

 

 

<asp:Label ID="lblFormHeader" runat="server" SkinID="swPageHeaderLabel" meta:resourcekey="EditCorrFormHeaderLabel" />

 

 

</div>

 

 

<div style="padding: 30px;">

 

 

<table width="100%">

 

 

<tr>

 

 

<td style="padding-right: 5px" rowspan="3" valign="top">

 

 

<asp:Panel ID="GeneralPanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="GeneralPanel">

 

 

<div class="swGroupingPanelDiv">

 

 

<table width="100%" style=" padding-left:20px;">

 

 

<tr>

 

 

<td style="padding-right: 5px;">

 

 

<asp:Label ID="ComponentCategoryLabel" runat="server" AssociatedControlID="ddlCompCategory"

 

 

SkinID="swRequiredGridFieldLabel" meta:resourcekey="ComponentCategoryLabel" />

 

 

</td>

 

 

<td runat="server" id="ddlCompCategory_Container">

 

 

<telerik:RadComboBox ID="ddlCompCategory" runat="server" Skin="Office2007" Width="300px"

 

 

OnDataBinding="ComponentCategoryIDComboBox_DataBinding" meta:resourcekey="ddlCompCategoryResource1">

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="ComponentLabel" runat="server" AssociatedControlID="ddlComponent"

 

 

SkinID="swRequiredGridFieldLabel" meta:resourcekey="ComponentLabel" />

 

 

</td>

 

 

<td runat="server" id="ddlComponent_Container">

 

 

<telerik:RadComboBox ID="ddlComponent" runat="server" DataTextField="ComponentName" DataValueField="ComponentID" Width="300px"

 

 

meta:resourcekey="ddlComponentResource1" >

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="FulfillmentDocumentEditLabel" runat="server" AssociatedControlID="FulfillmentDocumentLabelTextBox"

 

 

SkinID="swRequiredGridFieldLabel" meta:resourcekey="FulfillmentDocumentLabel" />

 

 

</td>

 

 

<td runat="server" id="FulfillmentDocumentLabelTextBox_Container">

 

 

<asp:TextBox ID="FulfillmentDocumentLabelTextBox" runat="server" Text='<%# Eval("DocumentLabel") %>' Width="295px"

 

 

meta:resourcekey="FulfillmentDocumentLabelTextBoxResource1" SkinID="swGridTextbox">

 

 

</asp:TextBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="CorrespondenceEditLabel" runat="server" AssociatedControlID="CorrespondenceLabelTextBox"

 

 

SkinID="swGridFieldLabel" meta:resourcekey="CorrespondenceLabel" />

 

 

</td>

 

 

<td>

 

 

<asp:TextBox ID="CorrespondenceLabelTextBox" runat="server" Text='<%# Eval("CorrespondenceLabel") %>' Width="295px"

 

 

meta:resourcekey="CorrespondenceLabelTextBoxResource1" SkinID="swGridTextbox" ></asp:TextBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="txtCopiesLabel" runat="server" AssociatedControlID="txtCopies"

 

 

SkinID="swRequiredGridFieldLabel" Font-Size="12px" meta:resourcekey="txtCopiesLabel" />

 

 

</td>

 

 

<td runat="server" id="txtCopies_Container">

 

 

<telerik:RadNumericTextBox ID="txtCopies" runat="server" width="50px" MaxValue="9999" MinValue="0" Value="1"

 

 

Text='<%# Eval("Copies") %>' meta:resourcekey="txtCopiesResource1">

 

 

<numberformat decimaldigits="0" />

 

 

</telerik:RadNumericTextBox>

 

 

</td>

 

 

</tr>

 

 

<tr style="height:10px;">

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:CheckBox ID="chkPublicEdit" runat="server"

 

 

Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsPublic")) ? 0 : Eval("IsPublic")) %>'

 

 

meta:resourcekey="chkPublicEditResource" TextAlign="Right" SkinID="swGridCheckbox">

 

 

</asp:CheckBox>

 

 

</td>

 

 

<td>

 

 

<asp:CheckBox ID="chkRetainCopyEdit" runat="server"

 

 

Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsCopyRetained")) ? 0 : Eval("IsCopyRetained")) %>'

 

 

meta:resourcekey="chkRetainCopyEditResource" TextAlign="Right" SkinID="swGridCheckbox">

 

 

</asp:CheckBox>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</asp:Panel>

 

 

</td>

 

 

<td valign="top">

 

 

<asp:Panel ID="ElectronicStampPanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="ElectronicStampPanel">

 

 

<div class="swGroupingPanelDiv">

 

 

<table width="100%">

 

 

<tr>

 

 

<td colspan="4">

 

 

<asp:CheckBox ID="chkBurnEdit" runat="server" width="50px"

 

 

Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsBurned")) ? 0 : Eval("IsBurned")) %>'

 

 

AutoPostBack="True" OnCheckedChanged="ChkBurn_OnCheckChanged" meta:resourcekey="chkBurnEdit" TextAlign="Right" SkinID="swGridCheckbox"/>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="width:100px;">

 

 

<asp:Label ID="ElectronicStampWidthEditLabel" runat="server" SkinID="swGridFieldLabel" meta:resourcekey="ElectronicStampWidthResource"/>

 

 

</td>

 

 

<td>

 

 

<telerik:RadNumericTextBox ID="StampXTextBox" width="70px" runat="server"

 

 

Text='<%# Eval("ElecStampXCoordinate") %>'

 

 

MaxValue="9999" MinValue="0" Culture="English (United States)" LabelCssClass=""

 

 

meta:resourcekey="StampXTextBoxResource1" >

 

 

<numberformat decimaldigits="0" />

 

 

</telerik:RadNumericTextBox>

 

 

</td>

 

 

<td style="width:100px;">

 

 

<asp:Label ID="ElectronicStampHeightEditLabel" runat="server" SkinID="swGridFieldLabel" meta:resourcekey="ElectronicStampHeightResource"/>

 

 

</td>

 

 

<td>

 

 

<telerik:RadNumericTextBox ID="StampYTextBox" width="70px" runat="server"

 

 

Text='<%# Eval("ElecStampYCoordinate") %>'

 

 

MaxValue="9999" MinValue="0" Culture="English (United States)" LabelCssClass=""

 

 

meta:resourcekey="StampYTextBoxResource1" >

 

 

<numberformat decimaldigits="0" />

 

 

</telerik:RadNumericTextBox>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</asp:Panel>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Panel ID="GenerateComponentPanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="GenerateComponentPanel">

 

 

<div class="swGroupingPanelDiv">

 

 

<table width="100%">

 

 

<tr>

 

 

<td style="width:100px;">

 

 

<asp:CheckBox ID="chkPaperFilingEdit" runat="server"

 

 

Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsPaperFiling")) ? 0 : Eval("IsPaperFiling")) %>'

 

 

meta:resourcekey="chkPaperFilingEditResource1" TextAlign="Right" SkinID="swGridCheckbox">

 

 

</asp:CheckBox>

 

 

</td>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

<td style="width:100px;">

 

 

<asp:CheckBox ID="chkEFilingEdit" runat="server"

 

 

Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsEFiling")) ? 0 : Eval("IsEFiling")) %>'

 

 

meta:resourcekey="chkEFilingEditResource1" TextAlign="Right" SkinID="swGridCheckbox">

 

 

</asp:CheckBox>

 

 

</td>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</asp:Panel>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:Panel ID="DateRangePanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="DateRangePanel">

 

 

<div class="swGroupingPanelDiv">

 

 

<table width="100%">

 

 

<tr>

 

 

<td style="width:100px;">

 

 

<asp:Label ID="lblDataRangeFrom" runat="server" SkinID="swRequiredGridFieldLabel" meta:resourcekey="lblDataRangeFrom" AssociatedControlID="dtDateRangeFrom_TextBox"></asp:Label>

 

 

</td>

 

 

<td runat="server" id="dtDateRangeFrom_DatePicker_Container">

 

 

<telerik:RadMaskedTextBox ID="dtDateRangeFrom_TextBox" runat="server" Mask="##/##/####" meta:resourcekey="dtDateRangeFromPickerResource" Width="60px">

 

 

<ClientEvents OnBlur="UpdateCalendar" />

 

 

</telerik:RadMaskedTextBox>

 

 

<telerik:RadDatePicker ID="dtDateRangeFrom_DatePicker" runat="server" SkinID="Office2007" meta:resourcekey="dtDateRangeFromPickerResource" Width="22px">

 

 

<DateInput runat="Server" Style="display: none; width:1px;">

 

 

</DateInput>

 

 

<ClientEvents OnDateSelected="UpdateTextBox" />

 

 

</telerik:RadDatePicker>

 

 

</td>

 

 

<td style="width:100px;">

 

 

<asp:Label ID="lblDataRangeTo" runat="server" meta:resourcekey="lblDataRangeTo" AssociatedControlID="dtDateRangeTo_TextBox" SkinID="swGridFieldLabel"></asp:Label>

 

 

</td>

 

 

<td runat="server" id="dtDateRangeTo_DatePicker_Container">

 

 

<telerik:RadMaskedTextBox ID="dtDateRangeTo_TextBox" runat="server" Mask="##/##/####" meta:resourcekey="dtDateRangeToTextBoxResource" Width="60px">

 

 

<ClientEvents OnBlur="UpdateCalendar" />

 

 

</telerik:RadMaskedTextBox>

 

 

<telerik:RadDatePicker ID="dtDateRangeTo_DatePicker" runat="server" SkinID="Office2007" meta:resourcekey="dtDateRangeToPickerResource" Width="22px">

 

 

<DateInput runat="Server" Style="display: none; width:1px;">

 

 

</DateInput>

 

 

<ClientEvents OnDateSelected="UpdateTextBox" />

 

 

</telerik:RadDatePicker>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

</td>

 

 

<td>

 

MM/dd/yyyy

 

</td>

 

 

<td>

 

 

</td>

 

 

<td>

 

MM/dd/yyyy

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</asp:Panel>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2" align="right" style="font-size: medium">

 

 

<br />

 

 

<asp:LinkButton ID="btnSave" SkinID="swFormSaveLinkButton" runat="server"

 

 

CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

 

 

</asp:LinkButton>

 

 

&nbsp;&nbsp;

 

 

<asp:LinkButton ID="btnCancel" SkinID="swFormCancelLinkButton" runat="server"

 

 

CausesValidation="False" CommandName="Cancel">

 

 

</asp:LinkButton>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</div>

 

 

</div>

 

 

</div>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

</mastertableview>

 

</

 

telerik:RadGrid>

 

0
Pavlina
Telerik team
answered on 26 Feb 2010, 03:06 PM
Hello Chinna,

I followed your scenario and prepared a simple working application which is working as expected. Please check it out and let me know if it works for you or if I am missing something out.

I hope this helps.

Kind regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
chinna
Top achievements
Rank 1
answered on 05 Mar 2010, 01:21 PM
Hello Pavlina, 

Here with pasted the ASPX  page and  Code behind to reproduce the issue 
 
ASPX
--------

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ConfigureCorrespondencePacketsByLOB.ascx.cs"
    Inherits="FileOne.SystemWorks.Web.ConfigureCorrespondencePacketsByLOB" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Common/SystemMessageControl.ascx" TagName="SystemMessageControl"
    TagPrefix="uc1" %>
<%@ Import Namespace="FileOne.SystemWorks.Web" %>
<!--bof System Message -->
<asp:Panel ID="SystemMessagePanelControl" runat="server" Visible="False"
    meta:resourcekey="SystemMessagePanelControlResource1">
    <div width="100%">
        <uc1:SystemMessageControl ID="SystemMessageControl" runat="server" />
    </div>
</asp:Panel>
<!--eof System Message -->
<telerik:RadGrid ID="radGridCorrespondencePackets" runat="server" ShowGroupPanel="True" AllowPaging="True" PageSize="50" PagerStyle-AlwaysVisible="False"
        AutoGenerateColumns="False" AllowFilteringByColumn="True" AllowSorting="True" ShowStatusBar="True" Width="100%"
        OnNeedDataSource="radGrid_NeedDataSource" OnItemDataBound="radGrid_ItemDataBound" OnItemCommand="radGrid_ItemCommand"
        OnItemCreated="radGrid_ItemCreated" OnItemEvent="radGrid_ItemEvent" OnInsertCommand="radGrid_InsertCommand"
        OnDetailTableDataBind="radGrid_DetailTableDataBind" OnUpdateCommand="radGrid_UpdateCommand" OnDeleteCommand="radGrid_DeleteCommand"
        OnCancelCommand="radGrid_CancelCommand" OnPreRender="radGrid_PreRender" OnRowDrop="radGridCorrespondenceLiens_RowDrop"
        OnSelectedIndexChanged="RadGrid_SelectedIndexChanged" GridLines="None" meta:resourcekey="radGridCorrespondencePacketsResource1">
    <grouppanel id="SystemWorksStandardGridGroupPanel">
        <PanelStyle Width="100%" Height="20px"/>
    </grouppanel>
    <validationsettings enablevalidation="true" validationgroup="ParentGrid" />
    <clientsettings allowdragtogroup="False" allowkeyboardnavigation="true" clientevents-onkeypress="KeyPressed" allowrowsdragdrop="true"
            enablepostbackonrowclick="true">
        <ClientEvents OnKeyPress="KeyPressed"></ClientEvents>
        <Selecting AllowRowSelect="true" />
    </clientsettings>
    <mastertableview commanditemdisplay="Top" autogeneratecolumns="False" editmode="InPlace" tablelayout="Fixed" allowfilteringbycolumn="true"
            allowsorting="true" enablenorecordstemplate="true" filteritemstyle-width="10px" hierarchyloadmode="ServerOnDemand"
            showheaderswhennorecords="true" name="CorrespondencePacketParent" allowautomaticinserts="false" datakeynames="CorrPacketID,CorrPacketName">
        <FilterItemStyle Width="10px"></FilterItemStyle>
        <CommandItemTemplate>
            <table>
                <tr>
                    <td align="center">
                        <asp:LinkButton ID="CopyComponent" runat="server" CommandName="Copy" CommandArgument="Copycomponent"
                                SkinID="swGridCopyCompLinkButton" Enabled="False" meta:resourcekey="CopyComponentResource1" />
                    </td>
                    <td></td>
                    <td>
                        <asp:LinkButton ID="PasteComponent" runat="server" CommandName="Paste" CommandArgument="Pastecomponent"
                                SkinID="swGridPasteCompLinkButton" Enabled="False" meta:resourcekey="PasteComponentResource1"  />                 
                    </td>
                </tr>
            </table>
        </CommandItemTemplate>
        <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" ItemStyle-Wrap="false" EditImageUrl="../Images/EditRecord.gif"
                    InsertImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateText="Update"
                    CancelText="Cancel" EditText="Edit" meta:resourcekey="GridEditCommandColumnResource2">
                <HeaderStyle Width="40px"/>
                <ItemStyle Wrap="False"></ItemStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrPacketID" DataField="CorrPacketID" Visible="false" AllowFiltering="false"
                    meta:resourcekey="GridBoundColumnResource5">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn  UniqueName="CorrPacketName" DataField="CorrPacketName" Visible="true" AllowFiltering="true"
                    SortExpression="CorrPacketName" meta:resourcekey="GridTemplateColumnResource12">
                 <ItemTemplate>
                      <%# Eval("CorrPacketName")%>
                </ItemTemplate>
                <EditItemTemplate>
                      <%# Eval("CorrPacketName")%>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn  UniqueName="ProcessingActnValue" Visible="true" AllowFiltering="true" DataField="ProcessingActnValue"
                    SortExpression="ProcessingActnValue" meta:resourcekey="GridTemplateColumnResource13">
                 <ItemTemplate>
                      <%# Eval("ProcessingActnValue")%>
                </ItemTemplate>
                <EditItemTemplate>
                      <%# Eval("ProcessingActnValue")%>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn  UniqueName="LOBTypeValue" Visible="true" AllowFiltering="true" DataField="LOBTypeValue"
                    SortExpression="LOBTypeValue" meta:resourcekey="GridTemplateColumnResource14">
                 <ItemTemplate>
                      <%# Eval("LOBTypeValue")%>
                </ItemTemplate>
                <EditItemTemplate>
                      <%# Eval("LOBTypeValue")%>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="FilingTypeValue" Visible="true" AllowFiltering="true" DataField="FilingTypeValue"
                    SortExpression="FilingTypeValue" meta:resourcekey="GridTemplateColumnResource15">
                 <ItemTemplate>
                      <%# Eval("FilingTypeValue")%>
                </ItemTemplate>
                <EditItemTemplate>
                      <%# Eval("FilingTypeValue")%>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="IsAssocWithReturnValue" DataField="IsAssocWithReturn " Visible="false"
                    meta:resourcekey="GridBoundColumnResource6" >
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="IsAssocWithReturn" Visible="true" AllowFiltering="false" SortExpression="IsAssocWithReturn"
                    DataType="System.Boolean" meta:resourcekey="GridTemplateColumnResource16">
                <HeaderStyle Width="100px"/>
                <ItemTemplate>
                    <asp:CheckBox ID="Associate" runat="server" Checked='<%# Eval("IsAssocWithReturn") %>' Enabled="False"
                            meta:resourcekey="AssociateResource1">
                    </asp:CheckBox>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:CheckBox ID="AssociateCheck" runat="server" Checked='<%# Eval("IsAssocWithReturn") %>'
                            meta:resourcekey="AssociateCheckResource1" >
                    </asp:CheckBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <DetailTables>
            <telerik:GridTableView AllowFilteringByColumn="false" AllowSorting="false" AutoGenerateColumns="false" EditMode="EditForms"
                    CommandItemDisplay="Top" Name="CorrespondencePacketChild" runat="server"  Width="100%" DataKeyNames="CorrPacketDetailID,CorrPacketID"
                    meta:resourcekey="GridTableViewResource1" EditFormSettings-EditFormType="Template">
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
                <CommandItemTemplate>
                    <div>
                        <asp:Label ID="LabelInfo" runat="server" CssClass="swChildGridHeaderText" meta:resourcekey="LabelInfoResource1"/>
                    </div>
                    <div style="float: left; text-align: right">
                        <asp:LinkButton ID="AddNewChildDoc" runat="server" CommandName="InitInsert" CommandArgument="AddNewPacketComponents"
                                SkinID="swGridAddNewLinkButton" meta:resourcekey="AddNewChildDocResource1" />
                    </div>
                    <div style="float: right; text-align: right">
                        <asp:LinkButton ID="RefreshGridLinkButton" runat="server" SkinID="swGridRefreshLinkButton" CommandName="refresh"
                                meta:resourcekey="RefreshGridLinkButtonResource1">
                        </asp:LinkButton>
                     </div>
                    <asp:ValidationSummary ID="ValidationSummaryChild" runat="server" EnableClientScript="False" DisplayMode="List"
                            SkinID="swGridValidationSummary" ValidationGroup="ChildGrid" meta:resourcekey="ValidationSummaryChildResource1" />
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridEditCommandColumn ItemStyle-Wrap="false" ButtonType="ImageButton" EditImageUrl="../Images/EditRecord.gif"
                            InsertImageUrl="../Images/Office2007/16X16/saveHS.gif" UpdateImageUrl="../Images/Office2007/16X16/saveHS.gif"
                            UniqueName="EditColumn" meta:resourcekey="GridEditCommandColumnResource1">
                        <HeaderStyle Width="40px"/>
                        <ItemStyle Wrap="False"></ItemStyle>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../Images/DeleteRecord.gif" CommandName="Delete"
                            UniqueName="DeleteColumn" meta:resourcekey="GridButtonColumnResource1">
                        <HeaderStyle Width="20px"/>
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn UniqueName="CorrPacketID" DataField="CorrPacketID" Visible="false"
                            meta:resourcekey="GridBoundColumnResource1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrPacketDetailID" DataField="CorrPacketDetailID" Visible="false"
                            meta:resourcekey="GridBoundColumnResource2">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn  UniqueName="Sequence" Visible="true" AllowFiltering="true" SortExpression="Sequence"
                            meta:resourcekey="GridTemplateColumnResource1">
                        <HeaderStyle Width="50px"/>
                        <ItemTemplate>
                            <%# Eval("Sequence")%>
                        </ItemTemplate>

<%--                        <EditItemTemplate>
                            <%# Eval("Sequence")%>
                        </EditItemTemplate>
--%>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="ComponentCategoryValue" DataField="ComponentCatValue" 
                            Visible="false" meta:resourcekey="GridBoundColumnResource3">
                    </telerik:GridBoundColumn>
                    <%--bof Add New DateRange Columns--%>
                    <telerik:GridBoundColumn  UniqueName="DateRangeFrom" DataField="FromDate" SortExpression="FromDate" 
                            meta:resourcekey="DateRangeFrom">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  UniqueName="DateRangeTo" DataField="ToDate"  SortExpression="ToDate"
                            meta:resourcekey="DateRangeTo">
                    </telerik:GridBoundColumn>
                    <%--eof Add New DateRange Columns--%>
                   
                    <telerik:GridTemplateColumn UniqueName="ComponentCategoryID" DataField="ComponentCatValue" SortExpression="CompCategoryValue"
                            DataType="System.String" meta:resourcekey="GridTemplateColumnResource2">
                        <ItemTemplate>
                            <%# Eval("ComponentCatValue")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn EditFormColumnIndex="-1" UniqueName="CorrItemValue" DataField="CorrItemName" Visible="false"
                            meta:resourcekey="GridBoundColumnResource4">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="ComponentID" DataField="CorrItemName" meta:resourcekey="GridTemplateColumnResource3" >
                        <ItemTemplate>
                            <%# Eval("CorrItemName")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="FulfillmentDocumentLabel" AllowFiltering="false"
                            meta:resourcekey="GridTemplateColumnResource4" >
                        <ItemTemplate>
                            <asp:Label ID="FulfillmentDocumentLabel" runat="server" Text='<%# Eval("DocumentLabel") %>'
                                    meta:resourcekey="FulfillmentDocumentLabelResource1" >
                            </asp:Label> 
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn  UniqueName="CorrespondenceLabel" DataField="CorrespondenceLabel"  SortExpression="CorrespondenceLabel"
                            meta:resourcekey="GridTemplateColumnResource5">
                    </telerik:GridBoundColumn>
               
                    <%--<telerik:GridTemplateColumn UniqueName="CorrespondenceLabel" AllowFiltering="false" meta:resourcekey="GridTemplateColumnResource5" >
                        <ItemTemplate>
                            <asp:Label ID="CorrespondenceLabel" runat="server" Text='<%# Eval("CorrespondenceLabel") %>'
                                    meta:resourcekey="CorrespondenceLabelResource1" >
                            </asp:Label> 
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>--%>
                    <telerik:GridTemplateColumn UniqueName="IsBurned" DataField="IsBurned" AllowFiltering="false" Display="false"
                            meta:resourcekey="GridTemplateColumnResource6" >
                        <HeaderStyle Width="170px" HorizontalAlign="center"/>
                        <HeaderTemplate>
                            <table frame="void" border="0" width="100%">
                                <tr>
                                    <td colspan="3" align="center">
                                        <asp:Label ID="ElectronicStampTitleLabel" runat="server" meta:resourcekey="ElectronicStampTitleResource"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="50px">
                                        <asp:Label ID="ElectronicStampEnableLabel" runat="server" meta:resourcekey="ElectronicStampEnableResource"/>
                                    </td>
                                    <td width="50px">
                                        <asp:Label ID="ElectronicStampWidthLabel" runat="server" meta:resourcekey="ElectronicStampWidthResource"/>
                                    </td>
                                    <td width="50px">
                                        <asp:Label ID="ElectronicStampHeightLabel" runat="server" meta:resourcekey="ElectronicStampHeightResource"/>
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table frame="void" border="0" width="100%">
                                <tr>
                                    <td width="50px" style="border-style: none">
                                        <asp:CheckBox ID="chkBurn" runat="server" Checked='<%# Eval("IsBurned") %>' Enabled="False"
                                                meta:resourcekey="chkBurnResource1" />
                                    </td>
                                    <td width="50px" style="border-style: none">
                                        <asp:Label ID="StampXLabel" runat="server"
                                                Text ='<%# Eval("ElecStampXCoordinate") %>'
                                                meta:resourcekey="StampXLabelResource1" />
                                    </td>
                                    <td width="50px" style="border-style: none">
                                        <asp:Label ID="StampYLabel" runat="server"
                                                Text ='<%# Eval("ElecStampYCoordinate") %>'
                                                meta:resourcekey="StampYLabelResource1" />
                                    </td>
                                </tr>
                            </table>                      
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Pages" DataField="Pages" AllowFiltering="false" Display="false"
                            meta:resourcekey="GridTemplateColumnResource7">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="Label1Resource1"/>
                        </ItemTemplate>
<%--                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="TextBox1Resource1"></asp:TextBox>
                        </EditItemTemplate>
--%>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Copies" DataField="Copies" AllowFiltering="false"
                            meta:resourcekey="GridTemplateColumnResource8">
                        <HeaderStyle Width="70px"/>
                        <ItemTemplate>
                            <asp:Label ID="lblCopies" runat="server" Text='<%# Eval("Copies") %>' meta:resourcekey="lblCopiesResource1" ></asp:Label> 
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="IsPaperFiling" DataField="IsPaperFiling" AllowFiltering="false"
                            meta:resourcekey="GridTemplateColumnResource9" >
                        <HeaderStyle Width="50px"/>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkPaperFiling" runat="server" Checked='<%# Eval("IsPaperFiling") %>' Enabled="False"
                                    meta:resourcekey="chkPaperFilingResource1" >
                            </asp:CheckBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="IsEFiling" DataField="IsEFiling" AllowFiltering="false"
                            meta:resourcekey="GridTemplateColumnResource10" >
                        <HeaderStyle Width="50px"/>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkEFiling" runat="server" Checked='<%# Eval("IsEFiling") %>' Enabled="False"
                                    meta:resourcekey="chkEFilingResource1">
                            </asp:CheckBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="IsPublic" DataField="IsPublic" AllowFiltering="false"
                            meta:resourcekey="GridTemplateColumnResourcePublic" >
                        <HeaderStyle Width="50px"/>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkPublic" runat="server" Checked='<%# Eval("IsPublic") %>' Enabled="False"
                                    meta:resourcekey="chkPublicResource">
                            </asp:CheckBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Pages" DataField="Pages" AllowFiltering="false" Display="false"
                            meta:resourcekey="GridTemplateColumnResource11">
                        <ItemTemplate>
                            <asp:Label ID="lblPages" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="lblPagesResource1"/> 
                        </ItemTemplate>
<%--                        <EditItemTemplate>
                            <asp:TextBox ID="txtPages" runat="server" Text='<%# Eval("Pages") %>' meta:resourcekey="txtPagesResource1"></asp:TextBox>
                        </EditItemTemplate>--%>
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <EditColumn UniqueName="EditColumn">
                    </EditColumn>
                    <FormTemplate>
                        <div class="swGridAddEditOutterBorderDiv">
                            <div class="swGridAddEditInnerBorderDiv">
                                <div class="swGridAddEditWrapperDiv">
                                    <div class="GridHeader_Office2007" style=" margin-left:10px;">
                                        <asp:Label ID="lblFormHeader" runat="server" SkinID="swPageHeaderLabel" meta:resourcekey="EditCorrFormHeaderLabel" />
                                     </div>
                                    <div style="padding: 30px;">
                                        <table width="100%">
                                            <tr>
                                                <td style="padding-right: 5px" rowspan="3" valign="top">
                                                    <asp:Panel ID="GeneralPanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="GeneralPanel">
                                                        <div class="swGroupingPanelDiv">
                                                            <table width="100%" style=" padding-left:20px;">
                                                            <tr>
                                                                <td style="padding-right: 5px;">
                                                                    <asp:Label ID="ComponentCategoryLabel" runat="server" AssociatedControlID="ddlCompCategory"
                                                                        SkinID="swRequiredGridFieldLabel" meta:resourcekey="ComponentCategoryLabel" />
                                                                </td>
                                                                <td runat="server" id="ddlCompCategory_Container">
                                                                    <telerik:RadComboBox ID="ddlCompCategory" runat="server" Skin="Office2007"  Width="300px"
                                                                            OnDataBinding="ComponentCategoryIDComboBox_DataBinding" meta:resourcekey="ddlCompCategoryResource1">
                                                                    </telerik:RadComboBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="ComponentLabel" runat="server" AssociatedControlID="ddlComponent"
                                                                        SkinID="swRequiredGridFieldLabel" meta:resourcekey="ComponentLabel" />

                                                                </td>
                                                                <td runat="server" id="ddlComponent_Container">
                                                                    <telerik:RadComboBox ID="ddlComponent" runat="server" DataTextField="ComponentName" DataValueField="ComponentID" Width="300px"
                                                                            meta:resourcekey="ddlComponentResource1" >
                                                                    </telerik:RadComboBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="FulfillmentDocumentEditLabel" runat="server" AssociatedControlID="FulfillmentDocumentLabelTextBox"
                                                                        SkinID="swRequiredGridFieldLabel" meta:resourcekey="FulfillmentDocumentLabel" />

                                                                </td>
                                                                <td runat="server" id="FulfillmentDocumentLabelTextBox_Container">
                                                                    <asp:TextBox ID="FulfillmentDocumentLabelTextBox" runat="server" Text='<%# Eval("DocumentLabel") %>' Width="295px"
                                                                        meta:resourcekey="FulfillmentDocumentLabelTextBoxResource1" SkinID="swGridTextbox">
                                                                    </asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="CorrespondenceEditLabel" runat="server" AssociatedControlID="CorrespondenceLabelTextBox"
                                                                          SkinID="swGridFieldLabel" meta:resourcekey="CorrespondenceLabel" />

                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="CorrespondenceLabelTextBox" runat="server" Text='<%# Eval("CorrespondenceLabel") %>' Width="295px"
                                                                         meta:resourcekey="CorrespondenceLabelTextBoxResource1" SkinID="swGridTextbox" ></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>   
                                                                  <td>
                                                                        <asp:Label ID="txtCopiesLabel" runat="server" AssociatedControlID="txtCopies"
                                                                        SkinID="swRequiredGridFieldLabel" Font-Size="12px" meta:resourcekey="txtCopiesLabel" />

                                                                  </td>
                                                                  <td runat="server" id="txtCopies_Container">                    
                                                                        <telerik:RadNumericTextBox ID="txtCopies" runat="server" width="50px" MaxValue="9999" MinValue="0"  Value="1"
                                                                                Text='<%# Eval("Copies") %>' meta:resourcekey="txtCopiesResource1">
                                                                            <numberformat decimaldigits="0" />
                                                                        </telerik:RadNumericTextBox>
                                                                  </td>
                                                            </tr>
                                                            <tr style="height:10px;">
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:CheckBox ID="chkPublicEdit" runat="server"
                                                                            Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsPublic")) ? 0 : Eval("IsPublic")) %>'
                                                                            meta:resourcekey="chkPublicEditResource" TextAlign="Right" SkinID="swGridCheckbox">
                                                                    </asp:CheckBox>

                                                                </td>
                                                                <td>
                                                                    <asp:CheckBox ID="chkRetainCopyEdit" runat="server"
                                                                            Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsCopyRetained")) ? 0 : Eval("IsCopyRetained")) %>'
                                                                            meta:resourcekey="chkRetainCopyEditResource" TextAlign="Right" SkinID="swGridCheckbox">
                                                                    </asp:CheckBox>
                                                                </td>

                                                            </tr>
                                                            </table>
                                                        </div>
                                                    </asp:Panel>
                                                </td>
                                                <td valign="top">
                                                    <asp:Panel ID="ElectronicStampPanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="ElectronicStampPanel">
                                                        <div class="swGroupingPanelDiv">
                                                        <table width="100%">
                                                            <tr>
                                                                <td colspan="4">
                                                                    <asp:CheckBox ID="chkBurnEdit" runat="server" width="50px"
                                                                        Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsBurned")) ? 0 : Eval("IsBurned")) %>'
                                                                        AutoPostBack="True" OnCheckedChanged="ChkBurn_OnCheckChanged" meta:resourcekey="chkBurnEdit" TextAlign="Right" SkinID="swGridCheckbox"/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:100px;">
                                                                    <asp:Label ID="ElectronicStampWidthEditLabel" runat="server"  SkinID="swGridFieldLabel" meta:resourcekey="ElectronicStampWidthResource"/>
                                                                </td>
                                                                <td>
                                                                   <telerik:RadNumericTextBox ID="StampXTextBox" width="70px" runat="server" 
                                                                            Text='<%# Eval("ElecStampXCoordinate") %>'
                                                                            MaxValue="9999" MinValue="0" Culture="English (United States)" LabelCssClass=""
                                                                            meta:resourcekey="StampXTextBoxResource1" >
                                                                        <numberformat decimaldigits="0" />
                                                                    </telerik:RadNumericTextBox>

                                                                </td>
                                                                <td style="width:100px;">
                                                                    <asp:Label ID="ElectronicStampHeightEditLabel" runat="server" SkinID="swGridFieldLabel" meta:resourcekey="ElectronicStampHeightResource"/>
                                                                </td>
                                                                <td>
                                                                   <telerik:RadNumericTextBox ID="StampYTextBox" width="70px" runat="server" 
                                                                            Text='<%# Eval("ElecStampYCoordinate") %>'
                                                                            MaxValue="9999" MinValue="0" Culture="English (United States)" LabelCssClass=""
                                                                            meta:resourcekey="StampYTextBoxResource1" >
                                                                        <numberformat decimaldigits="0" />
                                                                    </telerik:RadNumericTextBox>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        </div>
                                                    </asp:Panel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Panel ID="GenerateComponentPanel" runat="server"  SkinID="swGridGroupingPanel" meta:resourcekey="GenerateComponentPanel">
                                                        <div class="swGroupingPanelDiv">
                                                        <table width="100%">
                                                            <tr>
                                                                <td style="width:100px;">
                                                                    <asp:CheckBox ID="chkPaperFilingEdit" runat="server"
                                                                            Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsPaperFiling")) ? 0 : Eval("IsPaperFiling")) %>'
                                                                            meta:resourcekey="chkPaperFilingEditResource1" TextAlign="Right" SkinID="swGridCheckbox">
                                                                    </asp:CheckBox>
                                                                </td>
                                                                <td>
                                                                &nbsp;
                                                                </td>
                                                                <td style="width:100px;">
                                                                    <asp:CheckBox ID="chkEFilingEdit" runat="server"
                                                                            Checked='<%# Convert.ToBoolean(Convert.IsDBNull(Eval("IsEFiling")) ? 0 : Eval("IsEFiling")) %>'
                                                                            meta:resourcekey="chkEFilingEditResource1"  TextAlign="Right" SkinID="swGridCheckbox">
                                                                    </asp:CheckBox>
                                                                </td>
                                                                <td>
                                                                &nbsp;
                                                                </td>

                                                            </tr>
                                                        </table>
                                                        </div>
                                                    </asp:Panel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Panel ID="DateRangePanel" runat="server" SkinID="swGridGroupingPanel" meta:resourcekey="DateRangePanel">
                                                        <div class="swGroupingPanelDiv">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td style="width:100px;">
                                                                        <asp:Label ID="lblDataRangeFrom" runat="server" SkinID="swRequiredGridFieldLabel" meta:resourcekey="lblDataRangeFrom" AssociatedControlID="dtDateRangeFrom_TextBox"></asp:Label>
                                                                    </td>
                                                                     <td runat="server" id="dtDateRangeFrom_DatePicker_Container">
                                                                        <telerik:RadMaskedTextBox ID="dtDateRangeFrom_TextBox" runat="server" Mask="##/##/####" meta:resourcekey="dtDateRangeFromPickerResource" Width="60px">
                                                                            <ClientEvents OnBlur="UpdateCalendar" />
                                                                        </telerik:RadMaskedTextBox>

                                                                        <telerik:RadDatePicker ID="dtDateRangeFrom_DatePicker" runat="server" SkinID="Office2007" meta:resourcekey="dtDateRangeFromPickerResource" Width="22px">
                                                                             <DateInput runat="Server" Style="display: none; width:1px;">
                                                                            </DateInput>
                                                                            <ClientEvents OnDateSelected="UpdateTextBox" />
                                                                       </telerik:RadDatePicker>
                                                                    </td>
                                                                    <td style="width:100px;">
                                                                        <asp:Label ID="lblDataRangeTo" runat="server" meta:resourcekey="lblDataRangeTo" AssociatedControlID="dtDateRangeTo_TextBox"  SkinID="swGridFieldLabel"></asp:Label>
                                                                    </td>
                                                                    <td runat="server" id="dtDateRangeTo_DatePicker_Container">
                                                                        <telerik:RadMaskedTextBox ID="dtDateRangeTo_TextBox" runat="server" Mask="##/##/####" meta:resourcekey="dtDateRangeToTextBoxResource" Width="60px">
                                                                            <ClientEvents OnBlur="UpdateCalendar" />
                                                                        </telerik:RadMaskedTextBox>
                                                                        <telerik:RadDatePicker ID="dtDateRangeTo_DatePicker" runat="server" SkinID="Office2007" meta:resourcekey="dtDateRangeToPickerResource" Width="22px">
                                                                            <DateInput runat="Server" Style="display: none; width:1px;">
                                                                            </DateInput>
                                                                            <ClientEvents OnDateSelected="UpdateTextBox" />
                                                                        </telerik:RadDatePicker>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        MM/dd/yyyy
                                                                    </td>
                                                                    <td>
                                                                    </td>
                                                                    <td>
                                                                        MM/dd/yyyy
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </asp:Panel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" align="right" style="font-size: medium">
                                                    <br />
                                                    <asp:LinkButton ID="btnSave" SkinID="swFormSaveLinkButton" runat="server"
                                                         CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                    </asp:LinkButton>
                                                    &nbsp;&nbsp;
                                                    <asp:LinkButton ID="btnCancel" SkinID="swFormCancelLinkButton" runat="server"
                                                         CausesValidation="False" CommandName="Cancel">
                                                    </asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </FormTemplate>
                </EditFormSettings>
            </telerik:GridTableView>
        </DetailTables>
    </mastertableview>
</telerik:RadGrid>

CodeBehind
------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Collections;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;

using Telerik.Web.UI;

using FileOne.SystemWorks.Web.Common;
using FileOne.SystemWorks.Web.CustomControls;

using FileOneFramework.DataAccessClient;
using FileOneFramework.DataAccessService;
using FileOneFramework.DataAttributes;
using FileOneFramework.DataAccessService.DataContracts;
using FileOneFramework.FinancialManagerService.DataContracts;

using System.ServiceModel;
using FileOneFramework.ConfigurationManager.DataContracts; //need this for ConfigurationManagerFault

using FileOneFramework.ConfigurationManagerClient;
using FileOneFramework.CorrespondenceManagerClient;
using FileOneFramework.CorrespondenceManagerService.DataContracts;

using System.ComponentModel;

namespace FileOne.SystemWorks.Web
{
    public partial class ConfigureCorrespondencePacketsByLOB : System.Web.UI.UserControl
    {
        [
        Category("Data"),
        Description("Line of Business used by this control")
        ]
        List<CorrPacketTestData> testbind = new List<CorrPacketTestData>();
        List<CorrPacketDetailsTestData> testbinddetails = new List<CorrPacketDetailsTestData>();
        public LineOfBusinessEnum? LOB { get; set; }

        #region Private Fields
        private cmCorrPacket _cmCorrPacket;
        private cmCorrPacketDetail _cmCorrPacketDetail;
        private int _parentCorrPacketId;
        private const string ChildValidationGroupName = "ChildGrid";
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        #region Grid Event Methods

        protected void radGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                switch (e.CommandName)
                {
                    case RadGrid.InitInsertCommandName:
                    case RadGrid.CancelCommandName:
                        break;
                    case RadGrid.ExpandCollapseCommandName:
                        foreach (GridItem item in e.Item.OwnerTableView.Items)
                        {
                            //allow only one item to be collapsed at a time; otherwise, errors from one child table are displayed for each expanded detail table
                            if (item.Expanded && item != e.Item)
                            {
                                item.Expanded = false;
                                item.Selected = false;
                            }
                        }
                        e.Item.Selected = true;
                        break;

                    case RadGrid.PerformInsertCommandName:
                        break;
                    case "Copy":
                        GridDataItem[] selecteditem = e.Item.OwnerTableView.GetSelectedItems();
                        if (selecteditem != null)
                        {
                            if (selecteditem.Count() > 0)
                            {
                                Session["copypacketId"] = selecteditem[0]["CorrPacketID"].Text;
                                LinkButton lnkbtnPaste = (LinkButton)radGridCorrespondencePackets.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl("PasteComponent");
                                lnkbtnPaste.Enabled = true;
                            }
                        }
                        break;
                    case "Paste":
                        GridDataItem[] destselecteditem = e.Item.OwnerTableView.GetSelectedItems();
                        if (destselecteditem != null)
                        {
                            if (destselecteditem.Count() > 0)
                            {
                                string existcomponentnames = string.Empty;

                                using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                                {
                                    existcomponentnames = client.GetCorrespondenceComponentNames(Convert.ToInt32(destselecteditem[0]["CorrPacketID"].Text));
                                }

                                  if (existcomponentnames.Length <= 0)
                                  {
                                      CopySelectedComponents(Convert.ToInt32(Session["copypacketId"]), Convert.ToInt32(destselecteditem[0]["CorrPacketID"].Text));
                                  }
                                  else
                                  {
                                      existcomponentnames="The following components already exist " + existcomponentnames   +".  Do you want to continue and overwrite the existing components?";
                                      RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("ConfirmOverComponents('" + existcomponentnames + "'," + Convert.ToInt32(Session["copypacketId"]) + "," + Convert.ToInt32(destselecteditem[0]["CorrPacketID"].Text) + ");");
                                  }
                              }
                          } 
                          break;
                    case "refresh":
                        e.Item.OwnerTableView.Rebind();
                        break;
                    default:
                        break;
                }
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        protected void RadGrid_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                GridDataItem[] selecteditem = radGridCorrespondencePackets.Items[0].OwnerTableView.GetSelectedItems();
                if (((Telerik.Web.UI.RadGrid)(sender)).SelectedItems[0].OwnerTableView.Name == "CorrespondencePacketParent")
                {
                    LinkButton lnkbtnCopy = (LinkButton)radGridCorrespondencePackets.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl("CopyComponent");
                    lnkbtnCopy.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        public void CopySelectedComponents(int sourceid, int destinationid)
        {
            try
            {
                using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                {
                    client.CopyCorrespondencePacketDetails(sourceid, destinationid);
                }

                GridDataItem[] selecteditem = radGridCorrespondencePackets.Items[0].OwnerTableView.GetSelectedItems();
                foreach (GridItem item in radGridCorrespondencePackets.Items[0].OwnerTableView.Items)
                {
                    //allow only one item to be collapsed at a time; otherwise, errors from one child table are displayed for each expanded detail table
                    if (item.Expanded && item != selecteditem[0])
                    {
                        item.Expanded = false;
                        item.Selected = false;
                    }
                }
                GridItem itemtest = radGridCorrespondencePackets.Items[0].OwnerTableView.Items[((Telerik.Web.UI.GridItem)(selecteditem[0])).ItemIndex];
                itemtest.Expanded = true;

            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        protected void radGrid_ItemEvent(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            try
            {
                //Set up Custom Page Control for Grid
                GridInitializePagerItem info = e.EventInfo as GridInitializePagerItem;
                if (info != null)
                {
                    e.Canceled = true;
                    (e.Item as GridPagerItem).PagerContentCell.Controls.Add(
                        new SWCustomPager(info.PagingManager, e.Item.OwnerTableView));
                }
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        protected void radGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            try
            {
                if (e.Item.OwnerTableView.Name == "CorrespondencePacketChild")
                {
                    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
                    {
                        //Add Clientside onclick event and min max dates to From & To datepickers
                        InitDatePickers(e.Item as GridEditableItem);

                        //the dropdown list will be the first control in the Controls collection of the corresponding cell
                        RadComboBox compCategory = (e.Item as GridEditableItem).FindControl("ddlCompCategory") as RadComboBox;

                        //attach SelectedIndexChanged event for the drodown control
                        compCategory.AutoPostBack = true;
                        compCategory.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(this.ComponentCategoryIDComboBox_IndexChanged);
                        compCategory.SelectedIndex = 0;

                        using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                        {
                            int packetID = Convert.ToInt32(Session["CorrPacketid"]);
                            cmCorrPacket packet = client.GetCorrespondencePacket(packetID);
                            Session["CorrPacketName"] = packet.CorrPacketName;   
                            if (packet != null)
                            {
                                //If there is no filing type we set the pages checkboxes
                                if (!packet.FilingTypeID.HasValue)
                                {
                                    //Control pagesTextBox = (e.Item as GridEditableItem)["Pages"].FindControl("txtPages");
                                    //pagesTextBox.Visible = false;

                                    Control chkBurnEdit = (e.Item as GridEditableItem).FindControl("chkBurnEdit");
                                    chkBurnEdit.Visible = false;

                                    Control xBox = (e.Item as GridEditableItem).FindControl("StampXTextBox");
                                    xBox.Visible = false;

                                    Control yBox = (e.Item as GridEditableItem).FindControl("StampYTextBox");
                                    yBox.Visible = false;
                                }
                            }
                        }                                               
                    }

                }

            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            vwcmCorrPacket[] _vmcmCorrPacket = null;

            try
            {
                //using (DataAccessServiceClient client = WebServiceClientFactory.Create<DataAccessServiceClient>())
                //{
                //    _vmcmCorrPacket=client.GetAllActiveCorrespondencePacketsByLOBID((int?)LOB);
                //    //_vmcmCorrPacket = client.GetAllActiveCorrespondencePackets();
                //}

                //if (_vmcmCorrPacket != null)
                //{
                //    radGridCorrespondencePackets.DataSource = _vmcmCorrPacket;
                //}
                //else
                //{
                //    vwcmCorrPacket[] _cmcorrpackettemp = new vwcmCorrPacket[0];
                //    radGridCorrespondencePackets.DataSource = _cmcorrpackettemp;
                //}
                CorrPacketTestData test;
                test = new CorrPacketTestData();
                test.CorrPacketID = 1;
                test.CorrPacketName = "UCC1 Accept";
                test.FilingTypeValue = "UCC1";
                test.IsAssocWithReturn = true;
                test.LOBTypeValue = "UCC CODE";
                test.ProcessingActnValue = 0;
                testbind.Add(test);

           
                test = new CorrPacketTestData();
                test.CorrPacketID = 3;
                test.CorrPacketName = "UCC3 Accept";
                test.FilingTypeValue = "UCC3";
                test.IsAssocWithReturn = true;
                test.LOBTypeValue = "UCC CODE";
                test.ProcessingActnValue = 0;
                testbind.Add(test);

                radGridCorrespondencePackets.DataSource = testbind;
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        protected void radGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            try
            {
                //GridDataItem parentDataItem = e.DetailTableView.ParentItem as GridDataItem;
                ////if (parentDataItem.Edit)
                ////{
                ////    return;
                ////}

                //int corrPacketId = null != parentDataItem.SavedOldValues["CorrPacketID"] ? Convert.ToInt32(parentDataItem.SavedOldValues["CorrPacketID"].ToString()) : Convert.ToInt32(parentDataItem["CorrPacketID"].Text);
                //_parentCorrPacketId = corrPacketId;
                //DbObjectBase[] itemDetails = null;

                //Session["CorrPacketid"] = corrPacketId;

                ////get packetcomponent details for passed packet id
                //using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                //{

                //    itemDetails = client.GetCorrespondencePacketDetailsByPacketID(_parentCorrPacketId);

                //}
                //if (itemDetails != null)
                //{
                //    e.DetailTableView.DataSource = itemDetails;
                //}
                //else
                //{
                //        vwcmCorrPacketDetail[] corrPacketdetails = new vwcmCorrPacketDetail[0];
                //        e.DetailTableView.DataSource = corrPacketdetails;
                //}

                CorrPacketDetailsTestData test;
                test = new CorrPacketDetailsTestData();
                test.CorrPacketID = 1;
                test.CorrPacketDetailID = 3;
                test.CorrespondenceLabel = "Acknowledgement Letter";
                test.CorrItemName = "Acknowledgement Letter";
                test.DocumentLabel = "Acknowledgement Letter";
                test.FromDate = DateTime.Now;
                test.ToDate = DateTime.Now;
                test.IsPublic = true;
                test.IsPaperFiling = true;
                test.IsEFiling = false;
                test.IsBurned = true;
                testbinddetails.Add(test);

            
                test = new CorrPacketDetailsTestData();
                test.CorrPacketID = 3;
                test.CorrPacketDetailID = 4;
                test.CorrespondenceLabel = "Acknowledgement Letter";
                test.CorrItemName = "Acknowledgement Letter";
                test.DocumentLabel = "Acknowledgement Letter";
                test.FromDate = DateTime.Now;
                test.ToDate = DateTime.Now;
                test.IsPublic = true;
                test.IsPaperFiling = true;
                test.IsEFiling = false;
                test.IsBurned = true;
                testbinddetails.Add(test);

                e.DetailTableView.DataSource = testbinddetails;

            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        protected void radGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                GridDataItem gridDataItem = e.Item as GridDataItem;

                if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "CorrespondencePacketChild")
                {
                    ImageButton imgButton = (ImageButton)gridDataItem["DeleteColumn"].Controls[0];
                    imgButton.Attributes.Add("onclick", "return confirm('Are you sure you want to delete " + gridDataItem["CorrItemValue"].Text + " component?')");

                    //Set default value as  Corr packet name.
                    if ((e.Item is GridEditFormInsertItem) && e.Item.IsInEditMode)
                    {
                        TextBox txtFullfilment = (e.Item as GridEditFormInsertItem).FindControl("FulfillmentDocumentLabelTextBox") as TextBox;
                    txtFullfilment.Text = Session["CorrPacketName"].ToString();
                    }

                    if (e.Item.IsInEditMode)
                    {
                        CheckBox chkPaperFiling = gridDataItem.FindControl("chkPaperFilingEdit") as CheckBox;
                        CheckBox chkEFiling = gridDataItem.FindControl("chkEFilingEdit") as CheckBox;
                        string confMessage = GetLocalResourceObject("Message_ConfirmGenerate").ToString();
                        imgButton = (ImageButton)gridDataItem["EditColumn"].Controls[0];
                        confMessage = String.Format("return ConfirmGenerate('{0}','{1}','{2}');",confMessage,chkPaperFiling.ClientID,chkEFiling.ClientID);
                        imgButton.Attributes.Add("onclick", confMessage);
                    }
                 
                }
               
                //Add and Edit mode in packet detailtable
                if (e.Item.OwnerTableView.Name == "CorrespondencePacketChild")
                {
                    GridEditableItem _editedItem = e.Item as GridEditableItem;
                    if (_editedItem == null) return;

                    if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted) //Add new
                    {
                        GridEditFormInsertItem InsertedForm = e.Item as GridEditFormInsertItem;
                        Label lblFormHeader = (Label)InsertedForm.FindControl("lblFormHeader");
                        lblFormHeader.Text = GetLocalResourceObject("AddCorrFormHeader").ToString();
                        RadComboBox ddlcomponent =
                            (RadComboBox) InsertedForm.FindControl("ddlComponent");
                        ddlcomponent.DataSource = new CorrespondenceComponent[0];
                        ddlcomponent.DataBind();
                       
                        #region Set default values
                        //From date should default to current date -- FR0319.3c
                        RadDatePicker dtDateRangeFrom_DatePicker =
                            InsertedForm.FindControl("dtDateRangeFrom_DatePicker") as RadDatePicker;
                        DateTime dtDefault = ConfigureCorrespondencePacketsByLOBHelper.GetFromDateDefaultValue();
                        dtDateRangeFrom_DatePicker.SelectedDate = dtDefault;
                        RadMaskedTextBox dtDateRangeFrom_TextBox = InsertedForm.FindControl("dtDateRangeFrom_TextBox") as RadMaskedTextBox;
                        SetDateMaskedText(dtDateRangeFrom_TextBox, dtDefault);

                        //Set retain copy default to checked
                        CheckBox chkRetainCopyEdit = InsertedForm.FindControl("chkRetainCopyEdit") as CheckBox;
                        chkRetainCopyEdit.Checked = ConfigureCorrespondencePacketsByLOBHelper.GetRetainCopyDefaultValue();

                        #endregion

                    }
                    else if (_editedItem is GridEditFormItem && _editedItem.IsInEditMode &&
                             !e.Item.OwnerTableView.IsItemInserted) // Edit mode
                    {
                        vwcmCorrPacketDetail updateCorrPacketDetails = (vwcmCorrPacketDetail)(_editedItem.DataItem);

                        //Set From & To MaskedTextBox Text Value
                        RadMaskedTextBox dtDateRangeFrom_TextBox = _editedItem.FindControl("dtDateRangeFrom_TextBox") as RadMaskedTextBox;
                        SetDateMaskedText(dtDateRangeFrom_TextBox, updateCorrPacketDetails.FromDate);

                        RadMaskedTextBox dtDateRangeTo_TextBox = _editedItem.FindControl("dtDateRangeTo_TextBox") as RadMaskedTextBox;
                        if (null != updateCorrPacketDetails.ToDate && DateTime.MinValue != updateCorrPacketDetails.ToDate)
                            SetDateMaskedText(dtDateRangeTo_TextBox, (DateTime)updateCorrPacketDetails.ToDate);

                        //Handle MinDate and Max Date binding for datepicker
                        RadDatePicker dtDateRangeFrom_DatePicker =
                            _editedItem.FindControl("dtDateRangeFrom_DatePicker") as RadDatePicker;
                        BindDatePicker(dtDateRangeFrom_DatePicker, updateCorrPacketDetails.FromDate, ConfigureCorrespondencePacketsByLOBHelper.GetFromDateDefaultValue());
                        RadDatePicker dtDateRangeTo_DatePicker =
                            _editedItem.FindControl("dtDateRangeTo_DatePicker") as RadDatePicker;
                        BindDatePicker(dtDateRangeTo_DatePicker, updateCorrPacketDetails.ToDate,null);

 

                        RadComboBox ddlCategorytype =
                            (RadComboBox)_editedItem.FindControl("ddlCompCategory");
                        ddlCategorytype.SelectedIndex =
                            ddlCategorytype.FindItemIndexByText(updateCorrPacketDetails.ComponentCatValue);

                        RadComboBox ddlcomponent =
                            (RadComboBox)_editedItem.FindControl("ddlComponent");
                        //TextBox pagesTextBox = _editedItem.FindControl("txtPages") as TextBox;
                        CheckBox chkBurnEdit = _editedItem.FindControl("chkBurnEdit") as CheckBox;
                        RadNumericTextBox xBox =
                            _editedItem.FindControl("StampXTextBox") as RadNumericTextBox;
                        RadNumericTextBox yBox =
                            _editedItem.FindControl("StampYTextBox") as RadNumericTextBox;
                        CorrespondenceComponent[] corrComponent;
                        CheckBox chkRetainCopy = _editedItem.FindControl("chkRetainCopyEdit") as CheckBox;

                        int packetID = Convert.ToInt32(Session["CorrPacketid"]);
                        cmCorrPacket packet;
                        using (
                            CorrespondenceManagerServiceClient client =
                                WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                        {
                            corrComponent =
                                client.GetComponentListByCategory(Convert.ToInt32(ddlCategorytype.SelectedValue));
                            packet = client.GetCorrespondencePacket(packetID);
                        }

                        //If there is no filing type we set the pages checkboxes                   
                        if (!packet.FilingTypeID.HasValue)
                        {
                            ///pagesTextBox.Visible = false;
                            chkBurnEdit.Visible = false;
                            xBox.Visible = false;
                            yBox.Visible = false;
                        }
                        else
                        {
                            // Also enable/disable the Pages textbox depending on the Category ID
                            int CategoryID = Convert.ToInt32(ddlCategorytype.SelectedValue);
                            if (CategoryID == (int) ComponentCategoryEnum.FiledDocuments ||
                                CategoryID == (int) ComponentCategoryEnum.OnlineForms)
                            {
                                //pagesTextBox.Visible = true;
                                chkRetainCopy.Enabled = false;
                                chkBurnEdit.Visible = true;
                                xBox.Visible = chkBurnEdit.Checked;
                                yBox.Visible = chkBurnEdit.Checked;
                            }
                            else
                            {
                                //pagesTextBox.Visible = false;
                                chkRetainCopy.Enabled = true;
                                chkBurnEdit.Visible = false;
                                chkBurnEdit.Checked = false;
                                xBox.Visible = false;
                                xBox.Value = null;
                                yBox.Visible = false;
                                yBox.Value = null;
                            }
                        }

                        ddlcomponent.DataSource = corrComponent;
                        ddlcomponent.DataBind();

                        ddlcomponent.SelectedIndex =
                            ddlcomponent.FindItemIndexByText(updateCorrPacketDetails.CorrItemName);

                    }
                }

            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }

        }

        protected void radGrid_InsertCommand(object source, GridCommandEventArgs e)
        {
            try
            {
                GridEditableItem item = e.Item as GridEditableItem;
                if (e.Item.OwnerTableView.Name == "CorrespondencePacketChild")
                {
                    //Create Correspondece Packet Detail object from edit template
                    _cmCorrPacketDetail = ConfigureCorrespondencePacketsByLOBHelper.GetCorrPacketDetailFromGridItem(item);

                    //Assign correspondence packet id from session
                    _cmCorrPacketDetail.CorrPacketID = Convert.ToInt32(Session["CorrPacketid"]);

                    //Validate inputs
                    Dictionary<string, string> dicValidationError =
                        ConfigureCorrespondencePacketsByLOBHelper.GetValidationError(_cmCorrPacketDetail);
                    switch (dicValidationError.Count)
                    {
                        case 0:
                            using (
                                CorrespondenceManagerServiceClient client =
                                    WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                            {
                                cmCorrPacketDetail detail = client.CreateCorrespondencePacketDetail(_cmCorrPacketDetail);
                                if (detail == null)
                                {
                                    e.Canceled = true;
                                    RadAjaxManager.GetCurrent(Page).Alert(
                                        GetLocalResourceObject("Message_PacketComponentExists").ToString()
                                        );
                                }
                            }
                            break;
                        default:
                            e.Canceled = true;
                            foreach(KeyValuePair<string,string> validationError in dicValidationError)
                            {
                                SetValidatorErrorEx(e.Item, validationError.Key, ChildValidationGroupName, validationError.Value);
                            }
                            break;
                    }
                }
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        protected void radGrid_UpdateCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            try
            {
                if (e.Item is GridEditableItem)
                {
                    GridEditableItem item = e.Item as GridEditableItem;

                    #region Update Parent Grid

                    if (e.Item.OwnerTableView.Name == "CorrespondencePacketParent")
                    {

                        GridDataItem gridDataItem = (GridDataItem)e.Item;
                        string corrPacketid;
                        corrPacketid =
                            editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CorrPacketID"].ToString();
                        using (
                            CorrespondenceManagerServiceClient client =
                                WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                        {
                            _cmCorrPacket = client.GetCorrespondencePacket(Convert.ToInt32(corrPacketid));
                            _cmCorrPacket.IsAssocWithReturn =
                                (gridDataItem["IsAssocWithReturn"].FindControl("AssociateCheck") as CheckBox).Checked;
                            client.UpdateCorrespondencePacket(_cmCorrPacket);
                        }

                    }

                    #endregion

                    #region Update child Grid

                    if (item.OwnerTableView.Name == "CorrespondencePacketChild")
                    {
                        _cmCorrPacketDetail =
                            ConfigureCorrespondencePacketsByLOBHelper.GetCorrPacketDetailFromGridItem(item);

                        //Validate inputs
                        Dictionary<string, string> dicValidationError =
                            ConfigureCorrespondencePacketsByLOBHelper.GetValidationError(_cmCorrPacketDetail);

                        switch (dicValidationError.Count)
                        {
                            case 0:
                                using (
                                    CorrespondenceManagerServiceClient client =
                                        WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                                {
                                    var _cmCorrPacketDetailDB =
                                        client.GetCorrespondencePacketDetail(
                                            Convert.ToInt32(
                                                item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CorrPacketDetailID"
                                                    ].ToString()));

                                    _cmCorrPacketDetailDB.ComponentCategoryID = _cmCorrPacketDetail.ComponentCategoryID;
                                    _cmCorrPacketDetailDB.ReportNameTypeID = _cmCorrPacketDetail.ReportNameTypeID;
                                    _cmCorrPacketDetailDB.CorrDocumentTypeID = _cmCorrPacketDetail.CorrDocumentTypeID;
                                    _cmCorrPacketDetailDB.OnlineFormsTypeID = _cmCorrPacketDetail.OnlineFormsTypeID;
                                    _cmCorrPacketDetailDB.Copies = _cmCorrPacketDetail.Copies;
                                    _cmCorrPacketDetailDB.IsBurned = _cmCorrPacketDetail.IsBurned;
                                    _cmCorrPacketDetailDB.ElecStampXCoordinate = _cmCorrPacketDetail.ElecStampXCoordinate;
                                    _cmCorrPacketDetailDB.ElecStampYCoordinate = _cmCorrPacketDetail.ElecStampYCoordinate;
                                    _cmCorrPacketDetailDB.IsEFiling = _cmCorrPacketDetail.IsEFiling;
                                    _cmCorrPacketDetailDB.IsPaperFiling = _cmCorrPacketDetail.IsPaperFiling;
                                    _cmCorrPacketDetailDB.CorrespondenceLabel = _cmCorrPacketDetail.CorrespondenceLabel;
                                    _cmCorrPacketDetailDB.DocumentLabel = _cmCorrPacketDetail.DocumentLabel;
                                    _cmCorrPacketDetailDB.IsPublic = _cmCorrPacketDetail.IsPublic;

                                    _cmCorrPacketDetailDB.FromDate   = _cmCorrPacketDetail.FromDate;
                                    _cmCorrPacketDetailDB.ToDate   = _cmCorrPacketDetail.ToDate;
                                    _cmCorrPacketDetailDB.IsCopyRetained  = _cmCorrPacketDetail.IsCopyRetained ;

 

                                    int recupdated = client.UpdateCorrespondencePacketDetail(_cmCorrPacketDetailDB);
                                    if (recupdated == 0)
                                    {
                                        e.Canceled = true;
                                        RadAjaxManager.GetCurrent(Page).Alert(
                                            GetLocalResourceObject("Message_PacketComponentExists").ToString());
                                    }
                                }
                                break;
                            default:
                                e.Canceled = true;
                                foreach (KeyValuePair<string, string> validationError in dicValidationError)
                                {
                                    SetValidatorErrorEx(e.Item, validationError.Key, ChildValidationGroupName,
                                                      validationError.Value);
                                }
                                break;
                        }

                    }

                    #endregion

                }
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        protected void radGrid_DeleteCommand(object source, GridCommandEventArgs e)
        {
            try
            {
                GridDataItem gridDataItem = (GridDataItem)e.Item;
                Hashtable ht = new Hashtable();
                gridDataItem.ExtractValues(ht);
                //Convert.ToInt32(gridDataItem["gridDataItem"].Text);
                using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                {
                    client.DeleteCorrespondencePacketDetail(Convert.ToInt32(ht["CorrPacketDetailID"]));
                }
                e.Item.OwnerTableView.Rebind();
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }

        }
        protected void radGrid_CancelCommand(object source, GridCommandEventArgs e)
        {

        }
        protected void radGrid_PreRender(object sender, EventArgs e)
        {

        }
        protected void radGridCorrespondenceLiens_RowDrop(object sender, GridDragDropEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(e.HtmlElement))
                {
                    //update sequence as per drag drop
                    if (e.DraggedItems[0].OwnerTableView.Name == "CorrespondencePacketChild")
                    {
                        if (e.DestDataItem != null && e.DestDataItem.OwnerTableView.Name == "CorrespondencePacketChild")
                        {
                            //reorder items
                            int corrpacketid = 0;
                            int corrpacketdetailid = 0;

                            foreach (GridDataItem draggedItem in e.DraggedItems)
                            {
                                corrpacketid = (int)draggedItem.GetDataKeyValue("CorrPacketID");
                                corrpacketdetailid = (int)draggedItem.GetDataKeyValue("CorrPacketDetailID");
                            }

                            //pass the corr. packet id , packet details id and dropped row index to save into database
                            using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                            {
                                client.UpdateCorrespondencePacketSequence(corrpacketid, corrpacketdetailid, e.DestDataItem.RowIndex - 1);
                            }
                            // commit to database and reload
                            e.DestDataItem.OwnerTableView.Rebind();
                        }
                    }
                }
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
            }
        }
        #endregion
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ComponentCategoryIDComboBox_DataBinding(object sender, EventArgs e)
        {
            try
            {

                if (!IsItemsRequested)
                {
                    RadComboBox comboBox = sender as RadComboBox;
                    SetComboBoxDataSource(comboBox, GridBuilderHelper.GetLookupListItems(typeof(luComponentCategory).FullName, null, null), true);
                }
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="comboBox"></param>
        /// <param name="dataSource"></param>
        /// <param name="insertEmpty"></param>
        private void SetComboBoxDataSource(RadComboBox comboBox, ListItemCollection dataSource, bool insertEmpty)
        {
            try
            {
                comboBox.DataTextField = "Text";
                comboBox.DataValueField = "Value";
                comboBox.DataSource = dataSource;
                if (dataSource != null)
                {
                    if (insertEmpty)
                    {
                        dataSource.Insert(0, new ListItem(String.Empty, String.Empty));
                    }
                    for (int index = 0; index < dataSource.Count; index++)
                    {
                        if (dataSource[index].Selected)
                        {
                            comboBox.SelectedIndex = index;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        public bool IsItemsRequested { get; set; }
        private void ComponentCategoryIDComboBox_IndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                CorrespondenceComponent[] corrComponent;
                GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem;
                RadComboBox compCategory = editedItem.FindControl("ddlCompCategory") as RadComboBox; ;
                RadComboBox component = editedItem.FindControl("ddlComponent") as RadComboBox;
                //TextBox pagesTextBox = editedItem["Pages"].FindControl("txtPages") as TextBox;
                CheckBox chkBurnEdit = editedItem.FindControl("chkBurnEdit") as CheckBox;
                RadNumericTextBox xBox = editedItem.FindControl("StampXTextBox") as RadNumericTextBox;
                RadNumericTextBox yBox = editedItem.FindControl("StampYTextBox") as RadNumericTextBox;
                CheckBox chkRetainCopy = editedItem.FindControl("chkRetainCopyEdit") as CheckBox;
               
                component.Items.Clear();

                if (compCategory.SelectedIndex > 0)
                {
                    int packetID = Convert.ToInt32(Session["CorrPacketid"]);
                    cmCorrPacket packet;
                    using (CorrespondenceManagerServiceClient client = WebServiceClientFactory.Create<CorrespondenceManagerServiceClient>())
                    {
                        corrComponent = client.GetComponentListByCategory(Convert.ToInt32(compCategory.SelectedValue));
                        packet = client.GetCorrespondencePacket(packetID);
                    }
                    //If there is no filing type we set the pages checkboxes                   
                    if (!packet.FilingTypeID.HasValue)
                    {
                        //pagesTextBox.Visible = false;
                        chkBurnEdit.Visible = false;
                        xBox.Visible = false;
                        yBox.Visible = false;
                    }
                    else
                    {
                        // Also enable/disable the Pages textbox depending on the Category ID
                        int CategoryID = Convert.ToInt32(compCategory.SelectedValue);
                        if (CategoryID == (int)ComponentCategoryEnum.FiledDocuments || CategoryID == (int)ComponentCategoryEnum.OnlineForms)
                        {
                            //pagesTextBox.Visible = true;
                            //pagesTextBox.Text = "All";
                            chkBurnEdit.Visible = true;
                            xBox.Visible = chkBurnEdit.Checked;
                            yBox.Visible = chkBurnEdit.Checked;
                            chkRetainCopy.Enabled = false;
                            chkRetainCopy.Checked = true;
                           
                        }
                        else
                        {
                            //pagesTextBox.Text = "";
                            //pagesTextBox.Visible = false;

                            chkRetainCopy.Enabled = true;
                            chkBurnEdit.Visible = false;
                            chkBurnEdit.Checked = false;
                            xBox.Visible = false;
                            yBox.Visible = false;
                        }
                    }

                    component.DataSource = corrComponent;
                    component.DataBind();
                }
            }
            catch (FaultException<CorrespondenceManagerFault> ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ComponentCategoryIDComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            try
            {
                RadComboBox comboBox = sender as RadComboBox;
                SetComboBoxDataSource(comboBox, GridBuilderHelper.GetLookupListItems(typeof(luComponentCategory).FullName,
                    null,
                    null), false);
                IsItemsRequested = true;
                comboBox.DataBind();
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        public void ChkBurn_OnCheckChanged(object sender, System.EventArgs e)
        {
            CheckBox cb = sender as CheckBox;
            GridEditableItem editedItem = (GridEditableItem) cb.NamingContainer;
            RadNumericTextBox xBox = editedItem.FindControl("StampXTextBox") as RadNumericTextBox;
            RadNumericTextBox yBox = editedItem.FindControl("StampYTextBox") as RadNumericTextBox;
           
            //TODO:  Add putting in the values for the stamp x and y if the check is checked, rather than "0"
            xBox.Visible = cb.Checked;
            xBox.Text =  string.Empty;

            yBox.Visible = cb.Checked;
            yBox.Text = string.Empty;
        }

        #region Validate Input
        /// <summary>
        /// validate that the pages entered are in format 1,2,3-7
        /// </summary>
        /// <param name="e">Event Args</param>
        /// <param name="validationGroupName">Validation Group</param>
        /// <param name="columnUniqueName">Column Name</param>
        /// <param name="strText">text to be validated</param>
        private void ValidatePages(ref GridCommandEventArgs e, string validationGroupName, string columnUniqueName, string strText)
        {
            try
            {
                if (strText.Trim().Length != 0 && strText.Trim().ToLower() != "all")
                {
                    Regex regex = new Regex(@"^(\d+)+((,\d+)*(,\d+-\d+)?)*(-\d+)?$", RegexOptions.IgnorePatternWhitespace);
                    string message = GetLocalResourceObject("Message_PageNumbeFormatError").ToString();
                    if (!regex.IsMatch(strText))
                    {
                        SetValidatorError(ref e,message, validationGroupName, columnUniqueName);
                    }

                    regex = new Regex(@"\d+-\d+", RegexOptions.IgnorePatternWhitespace);
                    MatchCollection matches = regex.Matches(strText);
                    string processString;
                    int pos, fromPage, toPage;
                    // process in a loop to make sure that page ranges are valid
                    foreach (Match match in matches)
                    {
                        processString = match.Value;
                        pos = processString.IndexOf("-");
                        fromPage = Convert.ToInt32(processString.Substring(0, pos));
                        toPage = Convert.ToInt32(processString.Substring(pos + 1));
                        if (toPage < fromPage)
                        {
                            SetValidatorError(ref e, message, validationGroupName, columnUniqueName);
                            break;
                        }
                    }

                    // also make sure that there are no 0 page numbers
                    regex = new Regex(@"(\d+)+", RegexOptions.IgnorePatternWhitespace);
                    matches = regex.Matches(strText);
                    // process in a loop to make sure that page ranges are valid
                    foreach (Match match in matches)
                    {
                        processString = match.Value;
                        if (Convert.ToInt32(processString) == 0)
                        {
                            SetValidatorError(ref e, message, validationGroupName, columnUniqueName);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SetValidatorError(ref e, ex.Message, validationGroupName, columnUniqueName);
            }
        }

        /// <summary>
        /// validate that the copies are numeric and >= 1
        /// </summary>
        /// <param name="e">Event Args</param>
        /// <param name="validationGroupName">Validation Group</param>
        /// <param name="columnUniqueName">Column Name</param>
        /// <param name="strText">text to be validated</param>
        private void ValidateCopies(ref GridCommandEventArgs e, string validationGroupName, string columnUniqueName, string strText)
        {
            try
            {
//                Regex regex = new Regex(@"^[1-9][0-9]*$|^[0][1-9]+$", RegexOptions.IgnorePatternWhitespace);
                Regex regex = new Regex(@"^[1-9][0-9]*$", RegexOptions.IgnorePatternWhitespace);
                if (!regex.IsMatch(strText))
                {
                    SetValidatorError(ref e, GetLocalResourceObject("ErrorMessage_CopiesGreaterThanOne").ToString(), validationGroupName, columnUniqueName);
                }
            }
            catch (Exception ex)
            {
                SetValidatorError(ref e, ex.Message, validationGroupName, columnUniqueName);
            }
        }

        #endregion

        #region Error Handling

        /// <summary>
        /// Adds a custom validation error to a column in a edit template.
        /// </summary>
        /// <param name="gridItem">edit template Item</param>
        /// <param name="ErrorMessage">Error message local resource id</param>
        /// <param name="ValidationGroup">Name of Validation Group to associate the Custom Validator with, if any.</param>
        /// <param name="ColumnUniqueName">Control Id. The error icon will appear with.</param>
        protected void SetValidatorErrorEx(GridItem gridItem, string errorMessageResourceId, string validationGroupName, string controlId)
        {
            try
            {
                string errorMessage = GetLocalResourceObject(errorMessageResourceId).ToString();
                CustomValidator valid = new CustomValidator();
                valid.EnableTheming = false;
                valid.CssClass = "swGridCustomValidator";
                valid.ValidationGroup = (validationGroupName.Trim().Length > 0) ? validationGroupName : string.Empty;
                valid.ErrorMessage = string.Format("- {0}", errorMessage);
                valid.IsValid = false;
                valid.ID = "CustomValidateCategory";
                Image img = new Image();
                img.SkinID = "swFieldValidationFailedImage";
                img.ImageUrl = "~/Images/exclamation.png";
                valid.Controls.Add(img);
                Label lblErrorText = new Label();
                lblErrorText.Text = errorMessage;
                lblErrorText.ControlStyle.ForeColor = System.Drawing.Color.Red;
                valid.Controls.Add(lblErrorText);
                gridItem.FindControl(controlId+"_Container").Controls.Add(valid);
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }
        /// <summary>
        /// Adds a custom validation error to a column in a grid during a GridCommandEvent.
        /// </summary>
        /// <param name="e">GridCommandEventArgs passed in from a Grid Command.</param>
        /// <param name="ErrorMessage">Error Message to display in validation summary. "- " will automatically precede the error message.</param>
        /// <param name="ValidationGroup">Name of Validation Group to associate the Custom Validator with, if any.</param>
        /// <param name="ColumnUniqueName">GridColumn Unique Name. The error icon will appear in this column.</param>
        protected void SetValidatorError(ref GridCommandEventArgs e, string errorMessage, string validationGroupName, string columnUniqueName)
        {
            try
            {
                GridDataItem gridDataItem = (GridDataItem)e.Item;
                if (gridDataItem != null)
                {
                    e.Canceled = true;
                    CustomValidator valid = new CustomValidator();
                    valid.EnableTheming = false;
                    valid.CssClass = "swGridCustomValidator";
                    valid.ValidationGroup = (validationGroupName.Trim().Length > 0) ? validationGroupName : string.Empty;
                    valid.ErrorMessage = string.Format("- {0}", errorMessage);
                    valid.IsValid = false;
                    valid.ID = "CustomValidateCategory";
                    Image img = new Image();
                    img.SkinID = "swFieldValidationFailedImage";
                    img.ImageUrl = "~/Images/exclamation.png";
                    valid.Controls.Add(img);
                    gridDataItem[columnUniqueName].Controls.Add(valid);
                }
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return;
            }
        }

        /// <summary>
        /// Return array of luCorrCategories used to populate filter ddl and edit/update ddl columns.
        /// </summary>
        /// <returns>luCorrCategory[]</returns>
        private DbObjectStandardLookup[] GetCompCategory()
        {
            try
            {
                DbObjectStandardLookup[] categories = null;
                using (LookupConfigurationServiceClient client = WebServiceClientFactory.Create<LookupConfigurationServiceClient>())
                {
                    categories = client.StandardLookupGetAllActiveLookupEntries(new luComponentCategory());
                }
                return categories;
            }
            catch (Exception ex)
            {
                ShowSystemMessage(SystemMessageControl.SystemMessageIcon.Error, ex.Message);
                return null;
            }
        }
        /// <summary>
        /// Displays the SystemMessage User Control and sets the icon and message to be displayed.
        /// </summary>
        /// <param name="icon">An icon of enum type SystemMessageControl.SystemMessageIcon</param>
        /// <param name="message">The string to be displayed</param>
        public void ShowSystemMessage(SystemMessageControl.SystemMessageIcon icon, string message)
        {
            this.SystemMessagePanelControl.Visible = true;
            this.SystemMessageControl.SystemIcon = icon;
            this.SystemMessageControl.SystemMessage = message;
        }
        /// <summary>
        /// Initialize mindate and maxdate for From and To datepicker
        /// Set onclick event for popup
        /// </summary>
        /// <param name="editableItem">the edittemplate where datepickers are in</param>
        private void InitDatePickers(GridEditableItem editableItem)
        {
            DateTime dtMinDate = ConfigureCorrespondencePacketsByLOBHelper.MinDate;
            DateTime dtMaxDate = ConfigureCorrespondencePacketsByLOBHelper.MaxDate;

            RadDatePicker dtDateRangeFrom_DatePicker =
                            editableItem.FindControl("dtDateRangeFrom_DatePicker") as RadDatePicker;
            dtDateRangeFrom_DatePicker.DatePopupButton.Attributes.Add("onclick",
                                                                string.Format("Popup('{0}'); return false;",
                                                                              dtDateRangeFrom_DatePicker.ClientID));
            dtDateRangeFrom_DatePicker.MinDate = dtMinDate;
            dtDateRangeFrom_DatePicker.MaxDate = dtMaxDate;

            RadDatePicker dtDateRangeTo_DatePicker =
                            editableItem.FindControl("dtDateRangeTo_DatePicker") as RadDatePicker;
            dtDateRangeTo_DatePicker.DatePopupButton.Attributes.Add("onclick",
                                                                string.Format("Popup('{0}'); return false;",
                                                                              dtDateRangeTo_DatePicker.ClientID));
            dtDateRangeTo_DatePicker.MinDate = dtMinDate;
            dtDateRangeTo_DatePicker.MaxDate = dtMaxDate;

        }
        /// <summary>
        /// Set date with format to datemaskedtextbox
        /// </summary>
        /// <param name="radMaskedTextBox">maskedbox reference</param>
        /// <param name="dateTime">datetime value</param>
        private void SetDateMaskedText(RadMaskedTextBox radMaskedTextBox,DateTime dateTime)
        {
            radMaskedTextBox.Text = dateTime.ToString("MM/dd/yyyy");
        }
        /// <summary>
        /// Handle binding for datepickers control
        /// </summary>
        /// <param name="radDatePicker">reference of datepicker</param>
        /// <param name="dateTime">datetime value</param>
        private void BindDatePicker(RadDatePicker radDatePicker, DateTime? dateTime,DateTime? defaultDateTime)
        {
            DateTime? bindingDateTime = dateTime;
            if (null != bindingDateTime)
            {
                //Check if binding value is less than MinDate
                int check = DateTime.Compare((DateTime)dateTime, ConfigureCorrespondencePacketsByLOBHelper.MinDate);
                if (check < 0)
                {
                    //Set SelectedDate to null since binding value is less than MinDate
                    bindingDateTime = defaultDateTime;
                }
                else
                {
                    //Check if binding value is greater than MaxDate
                    check = DateTime.Compare((DateTime)dateTime, ConfigureCorrespondencePacketsByLOBHelper.MaxDate);
                    if (check > 0)
                    {
                        //Set SelectedDate to null since bind value is greater then MaxDate
                        bindingDateTime = defaultDateTime;
                    }
                }
            }
            radDatePicker.SelectedDate = bindingDateTime;

        }

        #endregion
    }
    public class CorrPacketTestData
    {
        public int CorrPacketID { get; set; }
        public string CorrPacketName { get; set; }
        public int ProcessingActnValue { get; set; }
        public string LOBTypeValue { get; set; }
        public string FilingTypeValue { get; set; }
        public bool IsAssocWithReturn { get; set; }
    }
    public class CorrPacketDetailsTestData
    {
        public int CorrPacketID { get; set; }
        public int CorrPacketDetailID { get; set; }
        public string ComponentCatValue { get; set; }
        public DateTime FromDate { get; set; }
        public DateTime ToDate { get; set; }
        public string CorrItemName { get; set; }
        public string DocumentLabel { get; set; }
        public string CorrespondenceLabel { get; set; }
        public bool IsBurned { get; set; }
        public string Pages { get; set; }
        public int Copies { get; set; }
        public bool IsPaperFiling { get; set; }
        public bool IsEFiling { get; set; }
        public bool IsPublic { get; set; }

    }
}

0
chinna
Top achievements
Rank 1
answered on 09 Mar 2010, 11:41 AM

Hello Pavlina, 
 I have sent sample application to reproduce the issue.
 Could you please at the code let me know are you able to replicate the issue or not.  

Thanks ,
Koteswararao

 
 

0
Pavlina
Telerik team
answered on 09 Mar 2010, 04:16 PM
Hi Chinna,

I reviewed the code, and it looks correct. If the issue persists, you can open a formal support ticket, and send us a small working project(incl. CSS, images, skins, DB backup if needed and so on), demonstrating your setup and showing the unwanted behavior.
We will debug it locally, and get back to you with additional information on the matter.

Greetings,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
chinna
Top achievements
Rank 1
answered on 23 Mar 2010, 12:31 PM
thank you Pavlina for your quick response
I was able to resolve my issue  it happened on your application  due to filter expression overwritten by resource file created for the localization. 

Koteswararao

      
Tags
Grid
Asked by
chinna
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
chinna
Top achievements
Rank 1
Share this question
or