CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    UDT Array and FlexGrid

    Having problem updating a flexgrid with the contents of a UDT array. I have 10 customer records, each of which has 10 pieces of data. I need to search the array based on what user types into a text box and then update the flexgrid with data from the array. User can only search on the "name" field. All items in the array are strings.

    Think I know how to use InString to determine WHAT records to use for update, but not sure on code for loading them into the flexgrid. Should I be using the TextMatrix property? If so, how would this work in some sort of loop that would go through the entire array?

    Any help for this beginner would be GREATLY appreciated.


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: UDT Array and FlexGrid

    Yes, use TextMatrix property.
    something like this: if udtAr() is the array of udt then

    for i = LBound(udtAr,1) to UBound(udtAr,1)
    With MSFlexGrid1
    j = 0
    .TextMatrix(.FixedRow + i,.FixedColumn + j) = udtAr(i).JthField
    j = j + 1
    .TextMatrix(.FixedRow + i,.FixedColumn + j) = udtAr(i).JthField
    ' Since it is an UDT, i guess you have to list out all the fields like this:
    ' if it is a collection, you could have used
    ' another for loop
    end with
    next i




    RK

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

Featured