datagrid嵌套的问题
datagrid1中嵌套了datagrid2,请问如何在datagrid2中动态添加列呢??
For i = 0 To dttable.Rows.Count - 1
Dim strStat As String = dttable.Rows(i).Item( "stat ")
'------------check將要填加的列名是否與已有的列重名-------------
Dim k As Integer
Dim flg As Boolean = True
For k = 0 To DS.Tables( "tblprod ").Columns.Count - 1
If strStat = DS.Tables( "tblprod ").Columns(k).ColumnName Then
flg = False
Exit For
End If
Next
'--------------------end check-----------------------------
If flg Then
Dim dgColum As New BoundColumn
dgColum.HeaderText = dttable.Rows(i).Item( "stat ")
dgColum.DataField = dttable.Rows(i).Item( "stat ")
dgColum.HeaderStyle.ForeColor = System.Drawing.Color.FromName( "#464646 ")