skip navigation
Telerik UI for ASP.NET AJAX
Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
NEW
: Design Kits for Figma
Online Training
Document Processing Library
Embedded Reporting for web and desktop
Web
Kendo UI
UI for jQuery
UI for Angular
UI for React
UI for Vue
UI for Blazor
UI for ASP.NET Core
UI for ASP.NET MVC
UI for ASP.NET AJAX
Mobile
UI for .NET MAUI
UI for Xamarin
Document Management
Telerik Document Processing
Desktop
UI for .NET MAUI
UI for WinUI
UI for WinForms
UI for WPF
Reporting
Telerik Reporting
Telerik Report Server
Testing & Mocking
Test Studio
Test Studio Dev Edition
Telerik JustMock
CMS
Sitefinity
UI/UX Tools
ThemeBuilder
Design System Kit
Templates and Building Blocks
Debugging
Fiddler
Fiddler Everywhere
Fiddler Classic
FiddlerCap
FiddlerCore
Free Tools
VB.NET to C# Converter
Testing Framework
View all products
Overview
Demos
Roadmap
What's New
Roadmap
Release History
Migrate to Blazor
Docs & Support
Support and Learning
Support and Learning Hub
Docs
Demos
Virtual Classroom
Forums
Videos
Blogs
Accessibility and Security
Submit a Ticket
Productivity and Design Tools
Visual Studio Extensions
ThemeBuilder
Embedded Reporting
Pricing
Shopping cart
Login
Contact Us
Try now
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX
This is a migrated thread and some comments may be shown as answers.
Grid_PageSizeChanged problem
2 Answers
81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
liu qingshui
Top achievements
Rank 1
liu qingshui
asked on
18 Mar 2010,
06:20 AM
when the Grid_PageSizeChanged Event fire,there is error:
It is impossible to change
from “Telerik.Web.UI.RadGrid” to “Telerik.Web.UI.GridTableView”.
Please give me a idea!
protected
void
Grid_PageSizeChanged(
object
source, GridPageSizeChangedEventArgs e)
{
BindGridSpecial();
}
private
void
BindGridSpecial()
{
Template[] listAll = Template.FindAll();
List<TemplateItem> listTemplateItemAll =
new
List<TemplateItem>();
foreach
(Template tm
in
listAll)
{
if
(tm.IsSpecial ==
true
&& tm.TemplateID != 0)
{
TemplateVersion version = TemplateVersion.FindDeployVersion(tm.TemplateID);
TemplateCategory[] category0 = TemplateCategory.FindAll();
List<TemplateCategory> categoryList =
new
List<TemplateCategory>();
foreach
(TemplateCategory tc
in
category0)
{
if
(tc.TemplateVersion.ToString() == version.ToString())
{
TemplateCategory categroy = TemplateCategory.Find(tc.TemplateCategoryID);
TemplateItem[] itemList = TemplateItem.FindAll(version.TemplateVerID, categroy.TemplateCategoryID);
listTemplateItemAll.AddRange(itemList);
}
}
}
}
Grid.DataSource = listTemplateItemAll;
Grid.DataBind();
}
<
telerik:RadGrid
ID
=
"Grid"
runat
=
"server"
Width
=
"100%"
AllowPaging
=
"True"
AllowSorting
=
"True"
EnableViewState
=
"true"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
OnItemDataBound
=
"Grid_ItemDataBound"
OnPageIndexChanged
=
"Grid_PageIndexChanged"
OnPageSizeChanged
=
"Grid_PageSizeChanged"
OnSortCommand
=
"Grid_SortCommand"
>
<
MasterTableView
DataKeyNames
=
"TemplateItemID"
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"column2"
>
</
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
DataField
=
"Name"
HeaderText
=
"项"
SortExpression
=
"Name"
UniqueName
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Description"
HeaderText
=
"说明"
SortExpression
=
"Description"
UniqueName
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Item Type"
HeaderText
=
"类型"
SortExpression
=
"ItemType"
UniqueName
=
"Item Type"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"StartHour"
HeaderText
=
"开始时间"
SortExpression
=
"StartHour"
UniqueName
=
"StartHour"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"EndHour"
HeaderText
=
"截止时间"
SortExpression
=
"EndHour"
UniqueName
=
"EndHour"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"IsAudit"
HeaderText
=
"是否审核"
SortExpression
=
"IsAudit"
UniqueName
=
"IsAudit"
>
</
telerik:GridCheckBoxColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Add a comment
Submit comment
Cancel
2 Answers
, 1 is accepted
Sort by
Score
Date
0
Accepted
Tsvetoslav
Telerik team
answered on
19 Mar 2010,
07:57 AM
Hello liu,
You should be using
Advanced databinding
as opposed to
Simple data binding
.
Greetings,
Tsvetoslav
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.
Add a comment
Submit comment
Cancel
0
liu qingshui
Top achievements
Rank 1
answered on
19 Mar 2010,
11:33 AM
Thank your kind help.
Now I use the advanced databinding, but the problem is still there!
The new code is below:
protected
void
rgridview_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
USRoleScheduleLog[] roleScheduleLog = USRoleScheduleLog.FindAll();
rgridview.DataSource = roleScheduleLog;
}
Add a comment
Submit comment
Cancel
Answer this question
Drag and drop files here or
browse
to attach...
Browse
for files to attach...
Supported file types: PNG, JPG, JPEG, ZIP, RAR, TXT. Max total file size - 20MB.
Submit answer
Cancel
Tags
Grid
Asked by
liu qingshui
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
liu qingshui
Top achievements
Rank 1
Share this question
or
Copy link