DB Grid and Unbound Data 
Author Message
 DB Grid and Unbound Data

hi there,

How to use DB Grid for unbounded data ?

i need a sample which demonstrates use of dbgrid in unbound data mode. The
sample needs to be able to add rows to the grid programmatically. Also
deleting rows that were added to the grid should be possible.

Thnx in Advance

Mon, 10 May 2004 23:50:29 GMT  
 DB Grid and Unbound Data
For unbound data I strongly recommend you use the FlexGrid instead.
It's possible with the DBGrid but you have to do a lot of heavy coding
in about 4 of the grid's events. With the FlexGrid unbound data is
much easier:

0. Set the grid's Rows property to the number of rows you have in your
array. Add 1 for column headings if you want them.

1. Set the Cols property to the number of columns you have in your

2. Populate the column headings:
    For intCol = 0 To intLastCol
        FlexGrid1.TextMatrix(0, intCol) = "whatever"
    Next intCol

3. Use two nested loops to populate the data rows:
    For intRow = 1 To intLastRow
        For intCol = 0 To intLastCol
            FlexGrid1.TextMatrix(intRow, intCol) = array(intRow - 1,
        Next intCol
    Next intRow

That's it. The TextMatrix property is a two dimensional array
representing the cell contents. Both dimensions are zero-based. You
can format the data using the Format$ function as you populate the
TextMatrix, and you can adjust the column alignments using the
ColAlignment property.

Tue, 11 May 2004 17:34:55 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Unbound DB Grid

2. how to a row in a unbound db grid

3. how to add a row min unbound db grid

4. Locking an individual cell on an unbound Sheridan DB Grid

5. True DB Grid 6.0 (OLE) in unbound mode

6. DB Grid Unbound mode headache!

7. Help with DB Grid in unbound Mode

8. Unbound Data Grid how to update individual rows?

9. Data Grid in Unbound mode

10. Creating unbound data grids

11. Good UNBOUND Data Grid Controls

12. I need an easy-to-use Grid for unbound data


Powered by phpBB® Forum Software