Results 1 to 10 of 10

Thread: how to bring required cell of msflexgrid within the viewable screen

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    how to bring required cell of msflexgrid within the viewable screen

    i have populated msflexgride with perticular data, now on command buttun evend I want to search text from the gride. Coding duly seached but if the required text is below the screen then it does not scroll automatically so that searched item can be viewed. I have following code which search and color the text but does not scroll automatically to come the text in viewable area. Please advise any help.

    If Gridbooking.Text = TextToSearch Then
    Gridbooking.CellBackColor = vbYellow
    ifornextitem = i
    Exit Sub

    End If

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    Code:
       MSFlexGrid1.TopRow = 5
       MSFlexGrid1.LeftCol = 7

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    Re: how to bring required cell of msflexgrid within the viewable screen

    i have changed my code as


    If Gridbooking.Text = TextToSearch Then
    Gridbooking.CellBackColor = vbYellow , ' its mean it text matches then change its color as yellow

    gridbooking.toprow = 5
    gridbooking.leftcol = 7

    end if

    but it has no effect our code. it just searches the relevant text, change its color but do not bring it to viewable screen area. please help.

  4. #4
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    Just woke up.
    I used the flexgrid for a few years, then about 10 years ago I switched to the free SGrid2.
    It has a method for doing what you want, but that equivalent is not present in the flexgrid (not the same name).
    I will knock up an example (for myself with enough data for me to experiment with), and I will find the command, if it kills me

    Never fear, Rob is near.

  5. #5
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    Are you using the MSFlexgrid or the MSHFlexgrid ?

    I just cannibalised a Database loading project I had (not bound), and the TopRow and LeftCol worked for me. Both scrollbars have scrolled, and the desired cell is visible.
    I will knock up a clean new version (no DB), and with clear cell identifiers, and attach it.
    I am using the MSFlexgrid, until I hear different from you
    Last edited by Bobbles; Jun 20th, 2012 at 04:31 AM.

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    Yup, my simple example is working, and is attached.

    Are you using MSFlex or MSHFlex ?
    My example is using MSFlex

    Are you using binding ?

    What is different between your project and mine ?
    Attached Files Attached Files

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    Re: how to bring required cell of msflexgrid within the viewable screen

    Sir, you are absolutely right, your example is working properly. There is slight mistake at my end ie i am uing MSHFLEXGRID instead o MSFlex. Please advise what i should do now. I cannot change the gride because in my application lot of working has already been done.
    Thanks a lot in advance.
    Imran

  8. #8
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    OK, I will try using the MSH grid

  9. #9
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to bring required cell of msflexgrid within the viewable screen

    The attached is working for me.

    Are you binding ?
    Attached Files Attached Files

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    23

    Re: how to bring required cell of msflexgrid within the viewable screen

    Thank you sir, now it solved.
    Kind regards.
    Imran

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