|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
add row ro gridviewHi, All,
can anyone tell me which method/property to add one more row ro gridview? Thanks, martin1 wrote:
> Hi, All, If it is attached to a DataSource, and the DataSource is a DataTable,> > can anyone tell me which method/property to add one more row ro gridview? > Thanks, 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 Show quoteHide quote "Brian Tkatch" wrote: > > martin1 wrote: > > 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. > > Brian,
gridView doesn't have DataTable property. Thanks Show quoteHide quote "Brian Tkatch" wrote: > > martin1 wrote: > > 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. > > martin1 wrote:
Show quoteHide quote > Brian, Does it have a DataSource property?> gridView doesn't have DataTable property. Thanks > > "Brian Tkatch" wrote: > > > > > martin1 wrote: > > > 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. > > > > B. 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 Show quoteHide quote "martin1" <mart***@discussions.microsoft.com> schreef in bericht news:2ADF6DBE-550F-4060-9A13-55AE27E262BD@microsoft.com... > Hi, All, > > can anyone tell me which method/property to add one more row ro gridview? > Thanks, >
Must call RemoveHandler after AddHandler?
IIS - Cannot create ActiveX component VS 2005 freezes during code editing (HotFix 917452) How to raise an event when a transaction is rollbacked .Net combo box - what is "opposite" of DropDown event? Configuration file Receive serial data Simple SQL question problem to read binary file Create a file hash |
|||||||||||||||||||||||