Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fill flexgrid with numbers? 1

Status
Not open for further replies.

thepunisher

Programmer
Jul 23, 2004
108
IE
hi,

I want to fill a flexgrid with numbers from 2 - 400.

the grid is 20x20.

I have never done any code before with flexgrids. usually ive done all my grid displays using listViews.

My first idea is a do until loop or something.

Or are there any easier methods?

thanks,

thePunisher.

Chief Dan George-Get ready little lady, hell is coming to breakfast
 
Loops is a good method for manually entering the information. I would nest the column loop within the row loop, something like this,
Code:
Dim i as Integer, j as Integer

For i = 0 to MSFlexGrid1.Rows - 1
   For j = 0 to MSFlexGrid1.Cols - 1
      MSFlexGrid1.TextMatrix(i, j) = <Value>
   Next j
Next i
If you have row headings (fixed row) then you should start your loop on row 1 instead of row zero. Same with columns. You will need to calculate the correct <value> to place in each cell.

zemp
 
Cheers, i'll try that.

The values entered are done in an incremental fashion.

2,3,4,5,6, etc... 400.

I should probably use the value of the incrementer as the value, makes the most sense.

thanks for the help.

thePunisher

Chief Dan George-Get ready little lady, hell is coming to breakfast
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top