We have been using Telrik MVC grid in our project.
Our requirement is to show 5000 records in the Grid.
Our approach: we stored 5000 records in a binary file on the server and then we bind 1000 records with the grid at a time. We are showing 1000 records in each page of the grid.
During pagination, that is, on the click of the next page number in the grid we again populate the grid with the next 1000 records from our binary file. This works fine and I am able to
browse through the grid. However, again when I initiate a new search, the pageindex of the grid showd be at 0, it doesn’t happen, the grid doesn’t get reset to the proper page, any subsequent grid binding results in error. The error message shown is “The parameter conversion from type 'System.String' to type 'System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' failed. See the inner exception for more information.”
I am looking for a solution….
Html.Telerik().Grid(Model.MatchingTags)
.Name(
"InstallBaseGrid")
.Columns(columns =>
{
columns.Template(o => {ERROR IS THROWN AT THIS POINT}
{
%>
<input name="checkedTags" type="checkbox" value="<%= o.SVC_TAG_ID %>"
/>
<%
}).Title(
"Check").Width(50).HtmlAttributes(new { style = "text-align:center" });
// Added the Hyperlink Column for the Service Tag Column
columns.Template(o =>
{
%>
<a href="#" onclick="OpenContractDetailsPopUp('<%=o.SVC_TAG_ID %>')"><%=o.SVC_TAG_ID%></a>
<%
}).Title(
"ServiceTagId").Width(100);
columns.Bound(o => o.BRAND_DESC).Width(250).Title(
"Brand Description");
columns.Bound(o => o.HW_SVC_LEVEL_CODE).Width(100).Title(
"Service Level");
columns.Bound(o => o.HW_SVC_LEVEL_DESC).Width(250).Title(
"Service Description");
columns.Bound(o => o.TECH_SUPPORT).Width(100).Title(
"Tech Support");
columns.Bound(o => o.TechSupportDateString).Format(
"{0:MM/dd/yyyy}").Width(150).Title("Tech Support Date");
columns.Bound(o => o.CCContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(100).Title("CC");
columns.Bound(o => o.KKContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(150).Title("KYHD");
columns.Bound(o => o.CUSTOMER_NUM).Width(100).Title(
"Customer #");
columns.Bound(o => o.LOCAL_CHANNEL).Width(150).Title(
"Local Channel");
columns.Bound(o => o.PRODUCT_DESC).Width(250).Title(
"Product Description");
columns.Bound(o => o.ContractStatus).Width(150).Title(
"HW Contract Status");
columns.Bound(o => o.ShipDateString).Format(
"{0:MM/dd/yyyy}").Width(150).Title("Ship Date");
columns.Bound(o => o.ContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(150).Title("Contract End Date");
columns.Bound(o => o.PO_NUM).Width(150).Title(
"PO #");
columns.Bound(o => o.BILL_TO_STATE_PROVINCE).Width(150).Title(
"Bill to State");
columns.Bound(o => o.BILL_TO_CITY).Width(200).Title(
"Bill to City");
columns.Bound(o => o.BILL_TO_POSTAL_CODE).Width(100).Title(
"Bill to Zip");
columns.Bound(o => o.SHIP_TO_ADDRESS_1).Width(200).Title(
"Ship to Address");
columns.Bound(o => o.SHIP_TO_STATE_PROVINCE).Width(200).Title(
"Ship to State");
columns.Bound(o => o.SHIP_TO_CITY).Width(200).Title(
"Ship to City");
columns.Bound(o => o.SHIP_TO_POSTAL_CODE).Width(100).Title(
"Ship to Zip");
columns.Bound(o => o.PENDING_FLAG).Width(100).Title(
"Pending?");
columns.Bound(o => o.OPEN_INCIDENT_FLAG).Width(150).Title(
"Open Incidents?");
columns.Bound(o => o.BASE_SKU_NUMBER).Width(100).Title(
"Base SKU");
columns.Bound(o => o.CHASSIS_ID).Width(150).Title(
"Chasis Id");
columns.Bound(o => o.SYSTEM_CLASS).Width(100).Title(
"System Class");
columns.Bound(o => o.ORDER_NUM).Width(200).Title(
"Contract Order Number");
columns.Bound(o => o.EOL_STATUS).Width(150).Title(
"EOL Status");
columns.Bound(o => o.HOLD_CODE).Width(100).Title(
"Hold Code");
//columns.Bound(o => o.AWR).Width(150).Title("WEN"); As per arun's suggestion we dont need this field for LA
columns.Bound(o => o.CDDContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(100).Title("CDD");
columns.Bound(o => o.HDRContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(150).Title("HDDR");
columns.Bound(o => o.EbsContractEndDateString).Format(
"{0:MM/dd/yyyy}").Width(100).Title("EBS");
})
.Pageable(settings => settings.Total(Model.RowCount))
.Scrollable(scrolling => scrolling.Enabled(
true).Height(Model.GridHeight))
.Pageable(pager => pager.PageSize(
string.IsNullOrEmpty(Dell.USP.AppService.StoreSettings.GetBuidSpecificValue("APOSNoRecordsPerCall", "3696"))
? 1000
:
Convert.ToInt32(Dell.USP.AppService.StoreSettings.GetBuidSpecificValue("APOSNoRecordsPerCall", "3696"))))
.Sortable()
.Filterable()
.Render();
%>
<!--Implementing the Popup for the Hyperlink clicked in the Install base Grid.-->
</
div>