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

Linq paging radajaxmanager

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Simmonds
Top achievements
Rank 1
David Simmonds asked on 30 Apr 2010, 08:14 PM
I have a form with a grid in it that uses a LinqDataSource. The Selecting event is wired up to return the number of rows. I use a RadAjaxManager and a RadAjaxLoadingPanel. However, when I click on a paging control the grid "flashes" and the loading "wheel" does not appear like the 300,000 Linq demo shows. The paging does work though. How do I make the loading stuff work? I have supplied the code for a cutback version of what I am doing in a real web app.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm8.aspx.cs" Inherits="CharityCheck.WebForm8" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <asp:Panel ID="Panel1" runat="server">  
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" ScriptMode="Release" /> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" > 
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"   
                Skin="Office2007" GridLines="None"   
                AutoGenerateColumns="False"   
                DataSourceID="LinqDataSource1" > 
                <MasterTableView TableLayout="Fixed" > 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="CompanyName" DefaultInsertValue=""   
                            HeaderText="CompanyName" SortExpression="CompanyName"   
                            UniqueName="CompanyName" ReadOnly="True" > 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ID" DefaultInsertValue="" 
                            HeaderText="ID" SortExpression="ID" UniqueName="ID"   
                            DataType="System.Int32" ReadOnly="True">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings>    
                    <selecting allowrowselect="True" /> 
                </ClientSettings>    
                <PagerStyle Position="TopAndBottom" /> 
            </telerik:RadGrid> 
 
            <asp:LinqDataSource ID="LinqDataSource1" runat="server"   
                AutoPage="False" ContextTypeName="CharityCheck.CharityCheckEntities"   
                onselecting="LinqDataSource1_Selecting"   
                TableName="CompanySet" OrderBy="CompanyName"   
                Select="new (CompanyName, ID)">  
            </asp:LinqDataSource> 
        </asp:Panel>         
    </div> 
    </form> 
</body> 
</html> 
 
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Infragistics.WebUI.UltraWebGrid;  
using Telerik.Web.UI;  
 
namespace CharityCheck  
{  
    public partial class WebForm8 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
 
        protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)  
        {  
            CharityCheckEntities entities = new CharityCheckEntities();  
            var data = from company in entities.CompanySet  
                       select company;  
            e.Arguments.TotalRowCount = data.Count();  
        }  
    }  
}  
 

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 05 May 2010, 10:29 AM
Hi David,

Please, try setting EnableLinqExpressions property to false and let me know about the result.

Regards,
Pavlina
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
David Simmonds
Top achievements
Rank 1
answered on 05 May 2010, 01:57 PM
That did not change anything. I had to add Skin="Default". That's pretty lame but at least it works.
Tags
Grid
Asked by
David Simmonds
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
David Simmonds
Top achievements
Rank 1
Share this question
or