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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flex Grid, 1

Status
Not open for further replies.

MrMoocow

Programmer
May 19, 2001
380
US
Hello,
I am amking a program where you can select a product and a quantity, then it gets added to a flex grid. But I can't get it to add the Product to the first column then the quantity in the second column.
HOW DO I DO THIS!
I tried setting flexgrid.col = 2

Brad,
Free mp3 player,games and more.
 
I'm now aware of this but it still sin't working.

Code:
MSFlexGrid1.Col = 0
MSFlexGrid1.AddItem cmbwinlist
MSFlexGrid1.Row = 1
MSFlexGrid1.AddItem txtquantity
Brad,
Free mp3 player,games and more.
 
Still doesn't work, IJ use JohnYingling code and it still places the text on on top of the other.

I need it to look like so

|Item||Amount||Price|
|Item||Amount||Price|
|Item||Amount||Price|

Here is what I am getting

|Item|
|Amount|

Sorry if I donn't quite "grasp" this but I'm a utility/game designer not financial. Brad,
Free mp3 player,games and more.
 
It is like a two dimensional array.
Code:
With grd
For I = .FixedRows to .Rows ' for each non-header row
    '         row dimension, col dimension
    .TextMatrix(I, 0) = 'col 1 data - item 
    .TextMatrix(I, 1) = 'col 2 data - amount
    .TextMatrix(I, 2) = 'col 3 data - price
    ' etc 
Next
End With
 
I'm sorry John I just can't get it to work, But I thank you for your effort (and thats why i gave u a star thing).

Thanks anyway. Brad,
Free mp3 player,games and more.
 
same as johns, but here we increment rows and pretty up the grid;
dim lRow as long
With FlexGrid
.Redraw = False
.Clear

.ColWidth(0) = .Width * 0.32
.ColWidth(1) = .Width * 0.33
.ColWidth(2) = .Width * 0.33

.FixedAlignment(0) = flexAlignCenterCenter
.FixedAlignment(1) = flexAlignCenterCenter
.FixedAlignment(2) = flexAlignCenterCenter

.ColAlignment(0) = flexAlignCenterCenter
.ColAlignment(1) = flexAlignCenterCenter
.ColAlignment(2) = flexAlignCenterCenter

.TextMatrix(0, 0) = "ITEM"
.TextMatrix(0, 1) = "AMOUNT"
.TextMatrix(0, 2) = "PRICE"

End With

lRow = 0
lRow = lRow + 1

FlexGrid.Rows = lRow + 1
flexGrid.TextMatrix(lRow, 0) = 'ItemData
flexGrid.TextMatrix(lRow, 1) = 'AmountData
FlexGrid.TextMatrix(lRow, 2) = 'PriceData

flxDisplay.Redraw = True
 
This option is also available to u MrMoo:

Dim TxtLine as String

TxtLine = txtItem.Text & vbTab & txtAmount.Text & vbTab & txtPrice.Text

grdMyFlexGrid.AddItem TxtLine

-Mike
Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top