B
BC
Hi,
Been searching the newgroups but haven't found an
answer.
I'm used to binding disconnected ADO recordsets
to Datagrid controls and tweaking the Datagrid to
suit my needs (columnheader, columnwidth, etc.)
Now I'm using vb.net, and I'm tryint to do the same
thing binding a Datareader to the Datagrid. If I bind
the Datagrid directly to the Datareader it works fine.
But if I:
myDataGrid.AutoGenerateColumns = False
Dim myColumn as BoundColumn
myColumn = New BoundColumn
myColumn.HeaderText = "Number"
myColumn.DataField = DataReader(0)
myDataGrid.Columns.Add(myColumn)
myDataGrid.DataSource = DataReader
myDataGrid.DataBind()
I get a column with the proper header, but no data
appears in the DataGrid. I realize that I should leave well
enough alone and let AutoGenerateColumns do it's job,
but I'd like to have a little more control.
Am I missing the boat here?
TIA,
BC
Been searching the newgroups but haven't found an
answer.
I'm used to binding disconnected ADO recordsets
to Datagrid controls and tweaking the Datagrid to
suit my needs (columnheader, columnwidth, etc.)
Now I'm using vb.net, and I'm tryint to do the same
thing binding a Datareader to the Datagrid. If I bind
the Datagrid directly to the Datareader it works fine.
But if I:
myDataGrid.AutoGenerateColumns = False
Dim myColumn as BoundColumn
myColumn = New BoundColumn
myColumn.HeaderText = "Number"
myColumn.DataField = DataReader(0)
myDataGrid.Columns.Add(myColumn)
myDataGrid.DataSource = DataReader
myDataGrid.DataBind()
I get a column with the proper header, but no data
appears in the DataGrid. I realize that I should leave well
enough alone and let AutoGenerateColumns do it's job,
but I'd like to have a little more control.
Am I missing the boat here?
TIA,
BC