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

RadGrid Not Sorting

1 Answer 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rachael
Top achievements
Rank 1
Rachael asked on 14 May 2011, 01:15 AM
This is very complicated, but I will try and explain.  I have a RadGrid that contains a Repeater inside a GridTemplateColumn.  The repeater is a usercontrol that I've written, that is a HyperLink with some javascript that accommodates an onmouseover effect.

I have many records in my database that use this display.  For most of them, I have no problems and the entire interface works as expected.  There is one record (at least that we've discovered so far) that gives me this bizarre problem: the page loads just fine and displays as expected, but when I click on a column to sort I get a "The connection was reset" error.  I have played around with this a bunch and have discovered that if I set the HyperLink in my usercontrol that is inside the repeater to "#" instead of a valid URL, the page works as expected.  If I set the URL to some long (but valid) URL (http://www.telerik.com/community/forums/new-thread.aspx?forumId=249, for example), the sorting behavior fails. 

Note: this problem ONLY occurs with this specific record - all other records that we have tested with exhibit the expected behavior.  And because setting the HyperLink NavigateUrl to a valid URL with appropriate characters also causes this unexpected behavior, it is clearly not an issue with our data.

So I think the problem might have to do with the ViewState size.  Are there any known issues related to ViewState size and RadGrid sorting? 

If necessary, if you give me a direct email address, I can give you the URL and login information to the staging site for you to reproduce the problem.  As I'm sure you understand, I don't want to post that information on a public forum.

Thank you,

Rachael

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 19 May 2011, 09:27 AM
Hello Rachael,

I assume that the problem is caused by a lot of data put into the ViewState and the size of it exceeded the set up maximum POST size.
Possible solutions could be:
Add this code to your page: (NET 2.0)
protected override PageStatePersister PageStatePersister
{
get
{
//return base.PageStatePersister;
return new SessionPageStatePersister(this);
}
}

This should put your ViewState into the Session, rather than in the page.

Increase the maximum Request limit (default is 4Mb)
- In the Machine.config file, change the maxRequestLength attribute of the <httpRuntime> configuration section to a larger value. This change affects the whole computer.
- In the Web.config file, override the value of maxRequestLength for the application. For example, the following entry in Web.config allows files that are less than or equal to 8 megabytes (MB) to be uploaded:
<httpRuntime maxRequestLength="8192" />
This is an exact quote from the Microsoft support page.

Please give it try and let me know if the issue still exists.

Best wishes,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Rachael
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or