Displaying Strings in a DataGrid Control

  • Thread starter Thread starter Duncan
  • Start date Start date
D

Duncan

I'm trying to display a string in a datagrid control and
can't workout how to do it. In VB6 i used a MSFlexGrid
ctrl.

flxProjNum.TextMatrix(1, 0) = "HELLO"

It seems the the datagrid control is supposed to be bound
to a datasource and display that.

Is there a way to do what i did in VB6? I am using an
Informix database with openlink ODBC drivers(so no data
adapters and sql server answers please!

Thanks

Duncan
 
So from the lack of response can i assume that you cannot
do what i proposed!

Is it the lack of sql server thats the problem?
 
Sorry if i wasn't clear i was just trying to be brief as
possible with the description of my problem.

So...

In vb6 i have used the flxgrid control to display simple
strings ie. set the flexgrid called flxProjNum
textmatrix property to Hello at row one, column zero to
equal "HELLO"

flxProjNum.TextMatrix(0, 0) = "HELLO"
flxProjNum.TextMatrix(1, 0) = "Goodbye"

Hello ! !
--------------------------
Goodbye! !
--------------------------
! !

I cannot find a way to do this with the asp.net datagrid
control. It seems to need a dataset object containing your
query results. I cannot do this because our ODBC
connection and database don't seem to be compatible with
the datagrid.

What i could do was just set the appropriate col and row
of the flxgrid the grid to equal the raw values from the
query. ie display a colum of ordernumbers

rs = adodb an recordset

do while not rs.eof

flxProjNum.TextMatrix(i, 0) = rs!ordernumber
rs.movenext
i = i +1
loop

Hope this helps to explain my problem better.
Duncan
 
Hi Duncan,

As far as I know, the grid has to be bound. If you're interested, our
Spread for Web Forms product will do what you need:

fpSpread1.Sheets(0).Cells(0,0).Text = "Hello"
fpSpread1.Sheets(0).Cells(1,0).Text = "Goodbye"

It can be used in bound mode or in unbound mode - no databinding
needed. Here's the link for more info, online demos, and video
tutorials:
http://www.fpoint.com/netproducts/spreadweb/spread.html

- Donald
 
Back
Top