ASP.NET中DataGrid加序号

ASP.NET中DateGrid加序号
创建一个模板列
再添加以下代码
< asp:TemplateColumn HeaderText = " 序号 " >
                                            
< HeaderStyle Width = " 120px " ></ HeaderStyle >
                                            
< ItemTemplate >
                                                
<% #Container.ItemIndex + 1 %>
                                            
</ ItemTemplate >
                                        
</ asp:TemplateColumn >
NinetyNine学习

你可能感兴趣的:(datagrid)