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

When trying to navigate to page 2 in RadGrid control I get an exception

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tanya
Top achievements
Rank 1
Tanya asked on 16 May 2014, 05:44 AM
ello I've got some problems wiht the paging of RadGrid Control! When it's first page - there is no problem it loads me three rows as I have given pageSize property value - "3". It also gives me - the right text - three Items Of 6 Items.  But when I try to get ti the second page - it gives me an error:

9
e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404


Her is my .aspx file 

<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false" AllowCustomPaging="false" AllowPaging="True" PageSize="3" OnPageIndexChanged="RadGrid2PageIndexChanged" OnNeedDataSource="radGridOnNeedDataSource" ><br>                          <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeControlType="RadComboBox"></PagerStyle><br>                             <MasterTableView><br>                                <Columns><br>                                      <telerik:GridBoundColumn DataField="ArticlegroupID" HeaderText="ArticleGrouipID" UniqueName="groupID">                           <br>                                      </telerik:GridBoundColumn><br><br>                                       <telerik:GridBoundColumn DataField="SpecialWord" HeaderText="ProductDescription" UniqueName="ProductDescr" ><br>                                       </telerik:GridBoundColumn>  <br>                                       <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="ImageFile"<br>                                            AlternateText="Customer image" <br>                                            ImageAlign="Middle" ImageHeight="100px" ImageWidth="82px" HeaderText="Image Column"><br>                                       </telerik:GridImageColumn>   <br>                                </Columns><br>                             </MasterTableView><br><br><br><br>                      </telerik:RadGrid>


And here is my cs File with only one function in which I get the data for datasource from a web service and bind it to the radGrid:

 
protected void radGridOnNeedDataSource(object source, GridNeedDataSourceEventArgs e)<br>        {<br><br>            RadGrid p_RadIconProducts = this.FindControl("RadGrid1") as RadGrid;<br><br>            List<WebServiceBeaMenu> radTileIcon = new List<WebServiceBeaMenu>();<br>            radTileIcon = MvcBeaDAL.WebServiceBea.GetArticle(p_menuID, p_articlegroupID, 1).ToList();<br>            p_RadIconProducts.DataSource = radTileIcon;<br>            p_RadIconProducts.MasterTableView.VirtualItemCount = radTileIcon.Count;<br>            p_RadIconProducts.CurrentPageIndex = p_RadIconProducts.MasterTableView.CurrentPageIndex;<br><br><br>        }

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 May 2014, 07:16 AM
Hello Tanya,

Please make sure you have only DataSource related logic in the NeedDataSource event handler and let me know about the result:
http://www.telerik.com/help/aspnet-ajax/grid-advanced-data-binding.html

Looking forward to your reply.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Tanya
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or