add row ro gridview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, All,

can anyone tell me which method/property to add one more row ro gridview?
Thanks,
 
martin1 said:
Hi, All,

can anyone tell me which method/property to add one more row ro gridview?
Thanks,

If it is attached to a DataSource, and the DataSource is a DataTable,
add a row to the DataTable.

Dim Row as DataRow
Row = DataTable.NewRow
DataTable.Rows.Add(Row)

Or compacted: DataTable.Rows.Add(DataTable.NewRow)

B.
 
Hi, Brian,

the datasource is SqlDataSource, how to add new row? can it convert
dataTable? the control i use is gridview for asp page rather than
datagridview. Thanks
 
Martin,

The GridView, DataGrid, DataGridView are controls made to show data from an
underlying datasource object (as it named now as an intermidiate in VS2005
as well).

In my opinion the best for that is the DataTable or even better its
defaultview (more times to use as the dataview).

In those predifined datasource classes are often multiple methods to add new
rows to a datatable.

Giving a best method is difficult because that depends on your program.

I hope this gives an idea,

Cor
 
Back
Top