动态创建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
'<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