动态创建datagrid序号

如何动态创建datagrid序号列
'<asp:TemplateColumn HeaderText="序号">
'<HeaderStyle Width="5%"></HeaderStyle>
'<ItemTemplate>
'<%# Container.ItemIndex+1%>
'</ItemTemplate>
'</asp:TemplateColumn>

Dim ItemIndexNO As New TemplateColumn
With ItemIndexNO
.HeaderText = "序号"
.HeaderStyle.Width = Unit.Pixel(50)
.HeaderStyle.HorizontalAlign = HorizontalAlign.Center

'<%# Container.ItemIndex+1%>
'(上面这句怎么写?)
End With
posted @ 2007-12-14 17:42  scgw  阅读(395)  评论(0编辑  收藏  举报