Results 1 to 5 of 5

Thread: FlexGrid question..pls answer

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    4

    FlexGrid question..pls answer

    I am using a MS Flex grid control . I am loading around 2000 records into the grid from database.

    After loading all the records (2000 records), (After loading when I look at the records in the GRid they look fine.)
    I am iterating thru each row in the grid. after iterating thru first 70 rows (I am using a FOR statement to iterate, suddenly, the FOR loop picks up the first record in the grid while it is supposed to pick up 71st record.

    Is there any limitations in iterating thru the rows of a MSFlex grid control?

    Any suggestions how to solve this problem please....?

    thank you

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    4

    CODE...

    dim i as integer
    for i = 1 to rslt.rows

    msgrid.row = i 'picking up next row from the gird
    msgrid.col = 3 'need advance number which is in column 3.
    sAdvnumber = msgrid.text

    'do some calculations based on the content of the row thats been selected. calls bunch of other complex functions here.

    next i

    Now I am suspecting, may be in the functions where I am calling the variable 'i' is being reset at the point 70th record is being called. Isn't it? And thats why the variable 'i' is going back to number 1 row instead of going to 71st row in the grid.

    so I guess I should declare the variable 'i' as a global variable rather than form level variable.

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    so I guess I should declare the variable 'i' as a global variable rather than form level variable.
    No, just the opposite. With "i" being local the way it is, other uses of that variable name will not affect the local use in the routine you posted. The only way that that could happen now would be if you were passing i ByRef (which is the default) to another routine. If you are not doing that then you probably have some chain of routines that is referring back to the routine you posted. To see if that is happening, set a breakpoint on the 1st line of code in that routine.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    4

    thanks martin.

    Let me try that tomorrow and see if that solves the problem

    regards

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