Results 1 to 6 of 6

Thread: DataGrid Help!

  1. #1
    Guest

    Question

    How would you go about setting focus to a new cell whenever a user has inserted a record? For example, every time the user press ENTER after inserting a record, a new row automaticlly display and is ready for another new recorder for input, I want the new row to have the focus (1st coloumn) so that the user doesn't need to use the mouse to set it. Any idea? I am totally new on dbgrid. I am using adodc with the dbgrid. Thanks!

  2. #2
    Guest

    Talking

    Nevermind.... I figured it out. Thanks!

  3. #3
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    I have this problem in my app, please let me know how did you figured it out, Thanks in advance

  4. #4
    Guest
    In the dbgrid property, under keyboard tab, select WrapCellPointer and in the TabAction - dbgGridNavigation.
    Hope this help.

  5. #5
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    Thank you for your reply
    I tried what you suggested and still did not work, Look at my AddNew click event, It may have a problem..What do you think about???

    Private Sub AddNew_Click()
    Data1.Recordset.MoveLast
    DBGrid1.AllowUpdate = True
    DBGrid1.AllowAddNew = True
    DBGrid1.SetFocus
    End Sub

    Thanks

  6. #6
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    I add the one line and it works fine..

    Private Sub AddNew_Click()
    Data1.Recordset.MoveLast
    DBGrid1.AllowUpdate = True
    DBGrid1.AllowAddNew = True
    DBGrid1.SetFocus
    DBGrid1.Row = DBGrid1.Row + 1
    End Sub

    You may have better way..
    Thanks

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