- I am using MS Visual Studio 2010 in a 3.5 environment.
- I am using Microsoft Vista (32 bit)
- The database is currently located on an SQL 2005 server.
- I am using RadGrid & tools, version 2012.1.411.35
- I am using both Chrome (18.0.1025.168) and Internet Explorer (8.0.7600.16385)
- I am programming in VB.net
I'll preface this with the fact that I don't really know anything about LinqToSql. I am trying to follow instructions online, but most always assume the reader knows more than I do.
I have an SQL database of 215,000 records that I loaded in a RadGrid with an ASP SqlDataSource. This was slow to load, filter, sort, and go to the next or previous page.
I came across the article Grid / 300 000 Rows with LINQ and tried to implement this and eventually I did. The data loads and I can do everything I did in the original setup. It is still slow except for filtering which is pretty quick. Nothing works fast like the demo on the page I linked above.
Also, the code sets the TotalRowCount to 300000, so even if it's filtered to 10 items, there are still loads of pages to page through which is odd.
I also attempted to apply the solutions located here Grid / Custom Paging, but again, it assumes the reader knows more than I do. It also uses demo files and whatnot, so I've been unable to get it working for me.
Basically, I want to speed this up. I'd like to get the LinqToSQL working properly.
The HTML for my page is:
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
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"
Skin
=
"Default"
></
telerik:RadAjaxLoadingPanel
>
<
br
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
AutoGenerateColumns
=
"False"
runat
=
"server"
DataSourceID
=
"LinqDataSource1"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowGroupPanel
=
"True"
CellSpacing
=
"0"
GridLines
=
"None"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
TableLayout
=
"Fixed"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"FilePath"
FilterControlAltText
=
"Filter FilePath column"
HeaderText
=
"FilePath"
ReadOnly
=
"True"
SortExpression
=
"FilePath"
UniqueName
=
"FilePath"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProjectID"
FilterControlAltText
=
"Filter ProjectID column"
HeaderText
=
"ProjectID"
ReadOnly
=
"True"
SortExpression
=
"ProjectID"
UniqueName
=
"ProjectID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Category"
FilterControlAltText
=
"Filter Category column"
HeaderText
=
"Category"
ReadOnly
=
"True"
SortExpression
=
"Category"
UniqueName
=
"Category"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProjectName"
FilterControlAltText
=
"Filter ProjectName column"
HeaderText
=
"ProjectName"
ReadOnly
=
"True"
SortExpression
=
"ProjectName"
UniqueName
=
"ProjectName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProjCoreTitle"
FilterControlAltText
=
"Filter ProjCoreTitle column"
HeaderText
=
"ProjCoreTitle"
ReadOnly
=
"True"
SortExpression
=
"ProjCoreTitle"
UniqueName
=
"ProjCoreTitle"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DrawingNumber"
FilterControlAltText
=
"Filter DrawingNumber column"
HeaderText
=
"DrawingNumber"
ReadOnly
=
"True"
SortExpression
=
"DrawingNumber"
UniqueName
=
"DrawingNumber"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DrawingTitle"
FilterControlAltText
=
"Filter DrawingTitle column"
HeaderText
=
"DrawingTitle"
ReadOnly
=
"True"
SortExpression
=
"DrawingTitle"
UniqueName
=
"DrawingTitle"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Description"
FilterControlAltText
=
"Filter Description column"
HeaderText
=
"Description"
ReadOnly
=
"True"
SortExpression
=
"Description"
UniqueName
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DrawingDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter DrawingDate column"
HeaderText
=
"DrawingDate"
ReadOnly
=
"True"
SortExpression
=
"DrawingDate"
UniqueName
=
"DrawingDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RecordCreated"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter RecordCreated column"
HeaderText
=
"RecordCreated"
ReadOnly
=
"True"
SortExpression
=
"RecordCreated"
UniqueName
=
"RecordCreated"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
AllowDragToGroup
=
"true"
></
ClientSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>
<
asp:LinqDataSource
ID
=
"LinqDataSource1"
AutoPage
=
"False"
runat
=
"server"
ContextTypeName
=
"ScanBrowser.ScanBrowserContext.ScanBrowserContext"
TableName
=
"BrowserGridTBL"
Select
=
"new (FilePath, ProjectID, Category, ProjectName, ProjCoreTitle, DrawingNumber, DrawingTitle, Description, DrawingDate, RecordCreated)"
>
</
asp:LinqDataSource
>
And the VB code behind that:
Imports
Telerik.Web.UI
Imports
System.Linq
Imports
System.Diagnostics
Public
Class
WebForm2
Inherits
System.Web.UI.Page
Protected
Sub
LinqDataSource1_Selected(sender
As
Object
, e
As
System.Web.UI.WebControls.LinqDataSourceStatusEventArgs)
Handles
LinqDataSource1.Selected
If
Not
Cache(
"MyData"
)
Is
Nothing
AndAlso
Not
e.Result
Is
Nothing
Then
Cache(
"MyData"
) = e.Result
End
If
End
Sub
Protected
Sub
LinqDataSource1_Selecting(sender
As
Object
, e
As
System.Web.UI.WebControls.LinqDataSourceSelectEventArgs)
Handles
LinqDataSource1.Selecting
e.Arguments.TotalRowCount = 300000
If
Not
Cache(
"MyData"
)
Is
Nothing
Then
e.Result = Cache(
"MyData"
)
End
If
End
Sub
Protected
Sub
RadAjaxManager1_AjaxSettingCreating(sender
As
Object
, e
As
Telerik.Web.UI.AjaxSettingCreatingEventArgs)
Handles
RadAjaxManager1.AjaxSettingCreating
If
Not
e.Updated
Is
RadGrid1
Then
e.UpdatePanel.RenderMode = UpdatePanelRenderMode.Inline
End
If
End
Sub
End
Class
Thank you for your assistance,
Rick
PS - Please have patience. You may need to step me through some of the stuff that may be simple to you. :)