给DataGrid添加Number列的简单方法

supposeDataGridnameddgCustomize, insertthefol
强烈推介IDEA2020.2破解激活,IntelliJ IDEA 注册码,2020.2 IDEA 激活码
suppose DataGrid named dgCustomize, insert the following code to the first column.

None.gif
<
asp:TemplateColumn 
HeaderText
="No."
>

None.gif    

<
ItemStyle 
HorizontalAlign
="Center"
></
ItemStyle
>

None.gif    

<
ItemTemplate
>

None.gif        

<
asp:Label 
runat
="server"
 Text
='<%# 
dgCustomize.CurrentPageIndex*dgCustomize.PageSize+dgCustomize.Items.Count+1 %
>
'>
None.gif        

</
asp:Label
>

None.gif    

</
ItemTemplate
>

None.gif

</
asp:TemplateColumn
>
本文来源21aspnet,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/2668

发表评论