ASPxGridView的自动排序(写在onCustomUnboundColumnData()事件中)

//此排序写于后台,可打印出序号 

protected void ASPxGridView_progoods_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewColumnDataEventArgs e)

        {

            if (e.Column.FieldName == "NO" && e.IsGetData)

                e.Value = (e.ListSourceRowIndex + 1).ToString();

          

        }

 

//此排序只girivew中,不能打印出来

<Columns>
<dx:GridViewDataTextColumn Caption="序号" VisibleIndex="0" Width="1%">
<EditFormSettings Visible="False" />
<CellStyle HorizontalAlign="Center"></CellStyle>
<DataItemTemplate>
<dx:ASPxLabel ID="L_rowid_1" runat="server" Text='<%# Container.ItemIndex + 1 %>'>
</dx:ASPxLabel>
</DataItemTemplate>
</dx:GridViewDataTextColumn>

</Columns>

posted @ 2015-12-27 14:53  小鹿的无名书  阅读(913)  评论(0编辑  收藏  举报