关于dev aspxgridview中的非绑定列序号连续累计或每页从1开始计算的方法
protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
{
if (e.Column.Caption == "序号")
{
//如果每页都从1开始计算序号用下面代码
ASPxGridView grd = sender as ASPxGridView;
int start_index = grd.VisibleStartIndex;
e.DisplayText = (e.VisibleIndex - start_index + 1).ToString();
//如何需要累计计算序号时用下面代码
//e.DisplayText = (e.VisibleIndex + 1).ToString();
}
}
秋风写于2019年11月19日,业务联系或技术交流:375172665
本文介绍在DevaSpxGridView中设置非绑定列序号的方法,包括每页序号从1开始或累计计算序号的实现技巧。

被折叠的 条评论
为什么被折叠?



