添加一个新的非绑定列,使用CustomColumnDisplayText事件来分配序号给该列
<dx:GridViewDataTextColumn Caption="序号" UnboundType="String" VisibleIndex="0"></dx:GridViewDataTextColumn>
PRotected void ASPxGridView1_CustomColumnDisplayText(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDisplayTextEventArgs e){if (e.Column.Caption == "序号"){e.DisplayText = (e.VisibleRowIndex + 1).ToString();}}
新闻热点
疑难解答