作者在 2007-04-17 23:11:00 发布以下内容
'*type为1表示要增加行 2为减去行
Private Sub rowChange(ByVal type As Integer,byval GridType as DataGrid)
Select Case type
Case 1
GridType.DataSource = CreateDataSource(Me.GridType.Items.Count + 1)
GridType.DataBind()
Case 2
GridType.DataSource = CreateDataSource(Me.GridType.Items.Count - 1)
GridType.DataBind()
End Select
End Sub
CreateDataSource(ByVal h As Integer) As ICollection
Dim dt As New DataTable
Dim dr As DataRow
Dim i As Integer
For i = 0 To h - 1
dr = dt.NewRow()
dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt)
Return dv
End