Doh, I've just resolved the problem a few hours ago in this way:
attention: dgvGriglia.DataSource = ds.Tables(1) is not an error because the table 0 is the source table which I manipulate in this procedure.vb Code:
dgvGriglia.AutoGenerateColumns = True Dim dt As New DataTable dt.Columns.Add(xAdd_ColToDT("Column0", "Header of column0")) dt.Columns.Add(xAdd_ColToDT("Column1", "Header of column1")) ... dt.Columns.Add(xAdd_ColToDT("ColumnN", "Header of columnN.")) For Each origa As DataRow In ds.Tables(0).Select(cFilter) Dim oNewRiga As DataRow = dt.NewRow oNewRiga.Item(0) = origa.Item("FIELD0") oNewRiga.Item(1) = origa.Item("FIELD1") dt.Rows.Add(oNewRiga) Next ds.Tables.Add(dt) dgvGriglia.DataSource = ds.Tables(1)
I resolved anyway, but do you think could be a good solution??
Thank you!




Reply With Quote