With the below ASPX page i am getting Sys.InvalidOperationException exception on paging. Please share me if anyone has solution for this. This problem is occuring in almost all the pages where i have used telerik GRid.
<
asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
</telerik:RadStyleSheetManager>
<telerik:RadScriptManager ID="ScriptManager1" runat="server">
</telerik:RadScriptManager>
<script src="../Scripts/ProviderEnrollment.js" language="javascript"></script>
<div id="divARReview">
<asp:Panel ID="pnlPE" runat="server" Width="100%" Height="30px" CssClass="collapsePanelHeader">
<div style="padding: 5px; cursor: pointer; vertical-align: middle;">
<div class="clsPanelHeading" style="float: left;">
<%
=Resources.PageTitles.pageProviderEnrollment%>
</div>
<div style="float: right; vertical-align: middle;">
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/expand_blue.jpg" />
</div>
</div>
</asp:Panel>
<asp:Panel ID="pnlProviderEnrollment" runat="server" Width="100%" Height="0" CssClass="collapsePanel">
<asp:UpdatePanel ID="upProviderEnrollment" runat="server">
<contenttemplate>
<TABLE cellSpacing="5" cellPadding="2" width="100%" align="left" border="0">
<TBODY>
<TR><TD colspan="2" align=left></TD></TR>
<TR>
<TD class="clsLabel" align="left" colspan="2" ><b>Select Carrier/ Provider</b></TD>
</TR>
<TR>
<TD align="left" colspan="2">
<telerik:RadGrid OnSelectedIndexChanged="grdPE_SelectedIndexChanged" id="grdPE" runat="server" Skin="Office2007" DataSourceID="objDataSrcPE" GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="5">
<SelectedItemStyle BackColor="#BDD6F5"></SelectedItemStyle>
<HeaderStyle BackColor="#E3EAF1"></HeaderStyle>
<ClientSettings>
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowCreated="RowCreatedCarrier" OnRowCreating="RowCreatingCarrier" OnRowDblClick="RowSelectedCarrier"></ClientEvents>
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataSourceID="objDataSrcPE">
<Columns>
<telerik:GridBoundColumn DataField="Carrier Name/Code/Plan" UniqueName="CarrierCodePlan" HeaderText="Carrier Name/Code/Plan"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="P/A" UniqueName="P/A" HeaderText="P/A"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Provider Name" UniqueName="ProviderName" HeaderText="Provider Name"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="New" UniqueName="New" HeaderText="New"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Open" UniqueName="Open" HeaderText="Open"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CarrierPlansRecordUID" UniqueName="CarrierPlansRecordUID" HeaderText="CarrierPlansRecordUID" Display="False"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ProviderUID" UniqueName="ProviderUID" HeaderText="ProviderUID" Display="False"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ProviderType" UniqueName="ProviderType" HeaderText="ProviderType" Display="False"></telerik:GridBoundColumn>
</Columns>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource id="objDataSrcPE" runat="server" TypeName="Kam.Web.ObjectDS.ProviderEnrollmentDS" SelectMethod="GetCarrierByGroupUID">
<SelectParameters>
<asp:ControlParameter PropertyName="Value" Type="Int64" DefaultValue="" Name="plGroupId" ControlID="hdnGroup"></asp:ControlParameter>
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="hdnGroup" runat="server"></asp:HiddenField>
<asp:HiddenField ID="hdnProviderType" runat="server"></asp:HiddenField>
<asp:HiddenField ID="hdnCarrierPlansRecordUID" runat="server"></asp:HiddenField>
<asp:HiddenField ID="hdnProviderUID" runat="server"></asp:HiddenField>
</TD>
</TR>
<tr style="display:none">
<td><asp:Button ID="btnCarriernRowSelected" runat="server" /> </td>
</tr>
<TR>
<TD class="clsLabel" align="left" width="47%"><b>Cases</b></TD>
<TD class="clsLabel" align="left"><b>Actions</b></TD>
</TR>
<tr class="clsLabel">
<td align="left" valign="top" colspan="2">
<table cellspacing="2" cellpadding="0" border="0" bordercolor="red" >
<tr>
<td width="30%" valign="top" align="left">
<table >
<tr>
<td valign="top" align="left">
<telerik:RadGrid id="grdCases" runat="server" Skin="Office2007" DataSourceID="objDataSrcCases" GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="5">
<SelectedItemStyle BackColor="#BDD6F5"></SelectedItemStyle>
<HeaderStyle BackColor="#E3EAF1"></HeaderStyle>
<ClientSettings>
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowCreated="RowCreatedCases" OnRowCreating="RowCreatingCases" OnRowDblClick="RowSelectedCases"></ClientEvents>
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataSourceID="objDataSrcCases">
<Columns>
<telerik:GridBoundColumn DataField="Case#" UniqueName="Case#" HeaderText="Case#"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Status" UniqueName="Status" HeaderText="Status"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Created By" UniqueName="Name" HeaderText="Crated By"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Created" UniqueName="New" HeaderText="Created"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FollowupUID" UniqueName="FollowupUID" HeaderText="FollowupUID"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ActionUID" UniqueName="ActionUID" HeaderText="ActionUID" Display="False"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PatientRecordUID" UniqueName="PatientRecordUID" HeaderText="PatientRecordUID" Display="False"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Comments" UniqueName="Comments" HeaderText="Comments" Display="False"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource id="objDataSrcCases" runat="server" TypeName="Kam.Web.ObjectDS.ProviderEnrollmentDS" SelectMethod="GetCases">
<SelectParameters>
<asp:ControlParameter PropertyName="Value" Type="Int64" DefaultValue="" Name="plGroupId" ControlID="hdnGroup"></asp:ControlParameter>
<asp:ControlParameter PropertyName="Value" Type="Int64" DefaultValue="" Name="plCarrierPlansUID" ControlID="hdnCarrierPlansRecordUID"></asp:ControlParameter>
<asp:ControlParameter PropertyName="Value" Type="String" DefaultValue="" Name="psProviderType" ControlID="hdnProviderType"></asp:ControlParameter>
<asp:ControlParameter PropertyName="Value" Type="Int64" DefaultValue="" Name="plProviderUID" ControlID="hdnProviderUID"></asp:ControlParameter>
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="hdnActionUID" runat="server" />
<asp:HiddenField ID="hdnChargeHeaderUID" runat="server" />
<asp:HiddenField ID="hdnApplyActionToAllFollowups" runat="server" />
<asp:HiddenField ID="hdnComments" runat="server" />
<asp:HiddenField ID="hdnActionMode" runat="server" />
<asp:HiddenField ID="hdnFollowUpIds" runat="server" />
</td>
</tr>
<tr>
<td>
<textarea id="txaComm" readonly="readonly" style="background-color:#C0C0C0" rows="3" cols="40"></textarea>
</td>
</tr>
</table>
</td>
<td width="12%" valign="top" align="left">
<img id="btnCaseHistory" src="../Images/btn_casehistory.gif" />
</td>
<td width="58%" valign="top" align="left">
<table cellpadding="0" width="100%" cellspacing="2" border="0" bordercolor="blue">
<tr>
<td width="10%">
<img id="btnPending" onclick="javascript:SetAction('44')" src="../Images/btn_Pending.gif" />
</td>
<td rowspan="3" width="90%">
<div id="divNotes" style="display:none">
<table cellpadding="0" cellspacing="3" border="0" bordercolor="green">
<tr>
<td colspan="2">
<textarea id="txaCommentsText" name="txaCommentsText" runat="server" rows="3" cols="47"></textarea>
</td>
</tr>
<tr>
<td align="left" width="35%"><asp:CheckBox ID="chkRefilClaim" runat="server" Text="Refile Claim" ></asp:CheckBox></td>
<td align="left" width="65%">
<asp:ImageButton ID="btnOk" runat="server" OnClientClick="return ConfirmForAllActions();" ImageUrl="~/Images/btn_ok.gif"></asp:ImageButton>
<img id="btnCancel" src="../Images/btn_cancel.gif" onclick="javascript:OnCancel()" />
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<img id="btnCloseItem" onclick="javascript:SetAction('1')" src="../Images/btn_CloseItem.gif" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<img id="btnReturnToAR" onclick="javascript:SetAction('45')" src="../Images/btn_ReturnToAR_Rep.gif" />
</td>
<td align="left" class="clsLabel">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</TBODY>
</TABLE>
</contenttemplate>
</asp:UpdatePanel>
</asp:Panel>
</div>
<AjaxTools:CollapsiblePanelExtender ID="cpe1" runat="Server" SuppressPostBack="true"
CollapsedImage="~/images/expand_blue.jpg" ExpandedImage="~/images/collapse_blue.jpg"
ImageControlID="Image1" CollapsedText="(Show Details...)" ExpandedText="(Hide Details...)"
TextLabelID="Label1" Collapsed="false" CollapseControlID="pnlPE" ExpandControlID="pnlPE"
TargetControlID="pnlProviderEnrollment">
</AjaxTools:CollapsiblePanelExtender>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function GetGrid()
{
var grid = $find("<%=grdCases.ClientID %>");
var hdnFollowUpIds = document.getElementById('ctl00_ContentPlaceHolder1_hdnFollowUpIds')
var hdnChargeHeaderIds = document.getElementById('ctl00_ContentPlaceHolder1_hdnChargeHeaderUID')
var MasterTable = grid.get_masterTableView();
var rows = MasterTable.get_dataItems()
var followUpIds;
var chargeHeaderUID = "";
var allFollowUpIds = "";
var allChargeHeaderIds = "";
var eachRow;
for (var row = 0; row < rows.length; row++)
{
eachRow = MasterTable.get_dataItems()[row]
followUpIds = MasterTable.getCellByColumnUniqueName(eachRow,
"FollowupUID");
chargeHeaderUID = MasterTable.getCellByColumnUniqueName(eachRow,
"Case#");
if (allFollowUpIds == "")
{
allFollowUpIds = followUpIds.innerHTML
}
else
{
allFollowUpIds = allFollowUpIds +
"," + followUpIds.innerHTML
}
if (allChargeHeaderIds == "")
{
allChargeHeaderIds = chargeHeaderUID.innerHTML
}
else
{
allChargeHeaderIds = allChargeHeaderIds +
"," + chargeHeaderUID.innerHTML
}
}
if (allFollowUpIds != "")
{
hdnFollowUpIds.value = allFollowUpIds
hdnChargeHeaderIds.value = allChargeHeaderIds
}
}
</script>
</telerik:RadCodeBlock>
</
asp:Content>