Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
"server"
>
AjaxSettings
telerik:AjaxSetting
AjaxControlID
"RadGrid1"
UpdatedControls
telerik:AjaxUpdatedControl
ControlID
></
</
telerik:RadAjaxLoadingPanel
"RadAjaxLoadingPanel1"
ToolTip
""
telerik:RadGrid
ShowGroupPanel
"true"
AllowFilteringByColumn
AllowPaging
"True"
AllowSorting
AllowCustomPaging
OnNeedDataSource
"RadGrid1_NeedDataSource"
OnGroupsChanging
"RadGrid1_GroupsChanging"
OnColumnCreated
"RadGrid1_ColumnCreated"
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadGrid1.VirtualItemCount = 10000;
//Set the VirtualItemCount
}
RadGrid1_NeedDataSource(
source, GridNeedDataSourceEventArgs e)
MyBusinessObjects MyBusinessObjectCollection1 =
new
MyBusinessObjects();
int
startRowIndex = (ShouldApplySortFilterOrGroup()) ?
0 : RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
maximumRows = (ShouldApplySortFilterOrGroup()) ?
MyBusinessObjectCollection1.SelectCount() : RadGrid1.PageSize;
RadGrid1.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
RadGrid1.DataSource = MyBusinessObjectCollection1.Select(startRowIndex, maximumRows);
bool
isGrouping =
false
;
RadGrid1_GroupsChanging(
source, GridGroupsChangingEventArgs e)
true
if
(e.Action == GridGroupsChangingAction.Ungroup && RadGrid1.CurrentPageIndex > 0)
public
ShouldApplySortFilterOrGroup()
return
RadGrid1.MasterTableView.FilterExpression !=
||
RadGrid1.MasterTableView.GroupByExpressions.Count > 0 || isGrouping) ||
RadGrid1.MasterTableView.SortExpressions.Count > 0;
RadGrid1_ColumnCreated(
sender, GridColumnCreatedEventArgs e)
(e.Column.IsBoundToFieldName(
"Date"
))
(e.Column
as
GridDateTimeColumn).DataFormatString =
"{0:D}"
else
"UnitPrice"
GridNumericColumn).DataFormatString =
"{0:C}"
is
GridBoundColumn)
GridBoundColumn).FilterControlWidth = Unit.Pixel(100);