AspxGridView添加序号列
using System.Globalization;//CultureInfo需要
protected void AspxGridView_stock_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
{
if (e.DataColumn.Caption.Trim() == "序号")
{
e.Cell.Text = ((e.VisibleIndex) + 1).ToString(CultureInfo.InvariantCulture);
}
}
需要在列表中绑定有名为‘序号’的列
浙公网安备 33010602011771号