Results 1 to 3 of 3

Thread: Populate Grid Manualy In Code

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    West Palm Beach, Florida
    Posts
    188

    Question 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

  2. #2
    Member
    Join Date
    Jun 2000
    Location
    Slovenia, Europe
    Posts
    58
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    West Palm Beach, Florida
    Posts
    188

    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
  •  



Click Here to Expand Forum to Full Width