|
-
May 6th, 2001, 04:29 AM
#1
Thread Starter
Addicted Member
Populate Grid Manualy In Code
I want to populate a grid control Manually using a loop ie.
mygrid.row=1
mygrid.col1 = 1
mygrid.text = format(rscustomer!amount1 + rscustomer!amount2, "Currency")
i know the code above is not valid. This is my problem I don't know how which grid control to use and how do i specify the row and column and tell it to insert text. Please help Need it urgently. It is very important that I populate this grid manually as i'm inserting various types of calculations.
chris
-
May 6th, 2001, 04:54 AM
#2
Member
I usually use MSFlexGrid contol.
The best way to populate MSFlexGrid is:
Code:
grid.FixedRows=1
grid.FixedCols=0
grid.Cols=2
grid.rows=rst.RecordCount+1 'one more for the header row
for i=1 to rst.RecordCount
grid.TextMatrix(i, 0)=rst.Fields(...)
grid.TextMatrix(i, 0)=rst.Fields(...)
next i
Hope it helps!
Tadej
-
May 6th, 2001, 05:07 AM
#3
Thread Starter
Addicted Member
Thanks
This Helps Alot I wonder If you can help me further, I'm Setting the grid's properties that it selects an entire row. I however want to hide a value behind every row. like with the list box or bcombobox itemdata control. The reason for this is if my user selects a spesific row I can then fin that recordset and for example print it etc. I.e the gird if filled with a list of orders for a customer, I then want the user to click on a order and when clicking a command button it will show that orders details.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|