Adds to the First Row only in VB

Asked By 20 points N/A Posted on -

Hello there guys!

I've been currently making a Visual Basic program.

In my Order Slip Entry part, every time I add up new details on the Flex Grid,

It only adds up on the first row only.

What would be the cause to this?

Answered By 0 points N/A #99260

Adds to the First Row only in VB


Hi Xavier,

I think you missed just a line of code or two for this problem. Remember that Flex Grid operates in row and column coordinates. When you add data to your flex grid you need to adjust the (column, row) values.

For example you have a flex grid with 5 columns. You may want to start to insert data at row 1 provided that row 0 are for column headers. Your first row of data could be like:

==Empno | Empname | Position | Address | Salary

row 1-> 1111  | xavier          | SA          | 15b. St.C|9999

row 2-> 2222  | hereddia    | SA          | Cor#2, B | 8888

To insert your data on the second row you need to code like:

FlexGrid.TextMatrix(2,0) = "2222"

FlexGrid.TextMatrix(2,1) = "heredia"

FlexGrid.TextMatrix(2,2) = "SA"

FlexGrid.TextMatrix(2,3) = "Cor#2,B"

FlexGrid.TextMatrix(2,4) = 8888

For shorter code you need to do it in a loop increasing the value of row so that Flex Grid inserts it in the next row.

I hope it helps.

Login/Register to Answer

Related Questions