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

[Solved] MVC grid problem

3 Answers 166 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arun Prasath
Top achievements
Rank 1
Arun Prasath asked on 09 Sep 2010, 03:47 PM

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>

 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 10 Sep 2010, 09:54 AM
Hi Arun Prasath,

Unfortunately It is hard to determine where could be the problem depending on the given information. I will ask you to open a support thread on the same matter and send us a simple test project which reproduces the depicted issue. Thus I will give all my best to find the reason of this erroneous behavior.

All the best,
Georgi Krustev
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
Raz
Top achievements
Rank 1
answered on 08 Feb 2012, 08:52 PM
I have a similar issue.

I have a Grid with paging and server binding. Grid gets populated by Search results. I can go through the pages, if there are multiple pages. 
Senario: If i am on page 8 on the first search results and do a search again, the grid defaults to page 8, if they are not enough records to populate page 8 it shows no records.
I used pageto in paging like ".Paging(paging => paging.PageTo(1))"  this dont work.
In the URL it shows the QString "-page=8"

How do i set default page as page 1.

Thanks
0
Russ
Top achievements
Rank 1
answered on 15 Aug 2012, 07:45 PM
Finally! Someone having the exact same problem I am. If I go to page 10 of my results and then do a new search, I am passing 1 to PageTo but it still tries to go to page 10, even if there aren't 10 pages of results. I can't reset it no matter what I do. Does anyone have a workaround for this product defect so I can move on with my project?
Thanks!
Tags
Grid
Asked by
Arun Prasath
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Raz
Top achievements
Rank 1
Russ
Top achievements
Rank 1
Share this question
or