More in this section
Forums / Developing with Sitefinity / [SiteFinity 5] RadGrid does not page

[SiteFinity 5] RadGrid does not page

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. diego
    diego avatar
    19 posts
    13 Jul 2011
    03 Apr 2012
    Link to this post
    i have created a page in which a radgrid receives data from a web service
    i have set the grid parameters (paging, page size) but they are not rendered
    here is the page code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="SitefinityWebApp.test" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <head runat="server">
        <telerik:RadCodeBlock runat="server" ID="ji">
        <script type="text/javascript">
            var obj = [];
            var lastI = 0;
            var map;
            var sDesc = new Array();
            var marker = new Array();
            var latlngArray = new Array();
            function pageLoad(sender, args) {
            function updateGrid(result) {
                var data = new Array(result.length);
                for (i = 0; i < data.length; i++) {
                    data[i] = { "site": result[i].Code, "name": result[i].Name, "site_responsible": result[i].Resp };
                var tableView = $find("<%= siteGrid.ClientID %>").get_masterTableView();
        <form id="form1" runat="server">
        <div style="width:900px;margin: auto;"></div>
        <div id="divLista">
    <telerik:RadScriptManager runat="server" ID="radscr">
            <asp:ServiceReference Path="~/GService.asmx" />
    <telerik:RadGrid ID="siteGrid" runat="server" AutoGenerateColumns="False"
        Width="750px" GridLines="None"
        Skin="Default" AllowFilteringByColumn="True" AllowPaging="true" PageSize="10" >
        <PagerStyle Mode="NextPrevAndNumeric" />
                    <GroupingSettings CaseSensitive="false" />
      <MasterTableView TableLayout="Fixed">
            <telerik:GridBoundColumn HeaderText="Site" DataField="site"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Site name" DataField="name"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Site responsible" DataField="site_responsible"></telerik:GridBoundColumn>
        <ClientEvents OnCommand="function(){}" />

    And this is the webservice:
        public class GService : System.Web.Services.WebService
            string connection = System.Configuration.ConfigurationManager.ConnectionStrings["tcdcConnectionString"].ConnectionString;
            List<mySite> siteSubList;
            List<mySite> gridList;
            public GService()
                //Uncomment the following line if using designed components

            [WebMethod(EnableSession = true)]
            public List<mySite> getGridData()//int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression
                gridList = new List<mySite>();
                //string sqlSelect = "SELECT id, site, [site responsible] as site_responsible, name, ecosystem, nlat, nlon from tcdc.dbo.sites where hide=0 order by site";
                string sqlSelect = "SELECT id, site, name,[site responsible] as site_responsible from tcdc.dbo.sites where hide=0 order by site";
                SqlConnection sqlConn = new SqlConnection(connection);
                SqlCommand cmd = new SqlCommand(sqlSelect, sqlConn);
                SqlDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                        int ii = int.Parse(rd["id"].ToString());
                        string st = rd["site"].ToString();
                        string nm = rd["name"].ToString();
                        string rr = rd["site_responsible"].ToString();
                        string eco = "";// rd["ecosystem"].ToString();
                        float la = 0;//float.Parse(rd["nlat"].ToString().Replace(',', '.'));
                        float lo = 0;// float.Parse(rd["nlon"].ToString().Replace(',', '.'));
                        mySite app = new mySite(ii, st, rr, nm, eco , lo, la);
                    catch (Exception e) { }
                return gridList;

    and this is the result...
    where is the problem?
1 posts, 0 answered