Results 1 to 10 of 10

Thread: [RESOLVED] Click the first flexgrid row

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    102

    Resolved [RESOLVED] Click the first flexgrid row

    How would I click the first flexgrid using a command button? I tried:

    flxMyGrid.Row = 1 (did not work)

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Click the first flexgrid row

    Don't quite understand you... try this instead:

    VB Code:
    1. With flxMyGrid
    2.     .Row = 1
    3.     .Col = .Cols - 1
    4.     .ColSel = 0
    5. End With
    Is this what you were after?

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Click the first flexgrid row

    Quote Originally Posted by swtransaction
    How would I click the first flexgrid using a command button? I tried:

    flxMyGrid.Row = 1 (did not work)
    You were half way there.

    VB Code:
    1. Private Sub Command1_Click()
    2.     flxMyGrid.Row = 2
    3.     Call flxMyGrid_Click
    4. End Sub

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    102

    Re: Click the first flexgrid row

    yes that helps, two issues:

    if there are no rows it gives an error

    it selects it, does not click it (when a row is clicked it populates a text box)

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Click the first flexgrid row

    Quote Originally Posted by swtransaction
    yes that helps, two issues:

    if there are no rows it gives an error

    it selects it, does not click it (when a row is clicked it populates a text box)
    You're talking about gavio's code, right?

  6. #6
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Click the first flexgrid row

    You have called it, now you have to actually define it:

    VB Code:
    1. Private Sub MSFlexGrid1_Click()
    2.     Text1.Text = "do it here"
    3. End Sub

  7. #7

  8. #8
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Click the first flexgrid row

    Quote Originally Posted by MartinLiss
    gavio, your code does not click the flexgrid.
    Yes... at first i missunderstood him. I was talking about your code. He/you had called it, now he has to define it. That's probobally why nothing happens. Am i wrong?

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    102

    Re: Click the first flexgrid row

    I'm back. Actually it wasn't click I was needing after all.

    flxMyGrid_SelChange

    the added If flxLastWorked.Rows > 1 Then

    Thanks. You guys got me on the right path, appreciate it!

  10. #10
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Click the first flexgrid row

    Now that we've helped you, you can pull down the Thread Tools menu and Mark Thread Resolved, so people will know you got your answer

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