我在Telerik 论坛上发布了这个,但我觉得我会在这里得到更快的回复,如果交叉发帖不受欢迎,我深表歉意。
我的 RadGrid 用于在每个网格的右下角显示页面和项目计数。我最近将 Telerik 从 v2011.3.1305 升级到 v2012.1.411。
我的一个网格的典型标记:
<telerik:RadGrid ID="AssetGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
AllowSorting="True" GridLines="None" GroupingSettings-CaseSensitive="false" Skin="Web20"
AutoGenerateColumns="False" OnPageIndexChanged="AssetGrid_PageIndexChanged" OnItemCreated="AssetGrid_ItemCreated"
OnItemDataBound="AssetGrid_ItemDataBound"
OnPreRender="AssetGrid_PreRender" OnSortCommand="AssetGrid_SortCommand" OnNeedDataSource="AssetGrid_NeedDataSource"
EnableLinqExpressions="false">
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
<ClientEvents OnRowDblClick="RowAssetSelected" />
</ClientSettings>
<MasterTableView EditMode="InPlace" AllowFilteringByColumn="true" ShowFooter="false"
EnableColumnsViewState="true" AutoGenerateColumns="false" CellSpacing="-1" DataKeyNames="AsId"
Font-Size="90%" AllowCustomSorting="true" AllowCustomPaging="true" Width="100%">
<PagerStyle Mode="NextPrevAndNumeric" Visible="true" AlwaysVisible="true" />
<!-- RowIndicatorColumn, ExpandCollapseColumn, Columns, etc -->
</MasterTableView>
</telerik:RadGrid>
我只在 NeedDataSource 的代码下面包含了,但如果其他任何人有帮助,请告诉我,我会发布它们:
protected void AssetGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
var collection = getAssets();
AssetGrid.VirtualItemCount = collection.Count;
AssetGrid.DataSource = collection.Skip(AssetGrid.PageSize *
AssetGrid.CurrentPageIndex).Take(AssetGrid.PageSize);
}
然而,网格正在显示寻呼机行,如下所示:
是否有我错过的设置来启用右下角的页面/项目计数,如几乎所有Telerik Pager 示例中所示?
提前致谢!