Results 1 to 3 of 3

Thread: Datagridview and textboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    3

    Exclamation Datagridview and textboxes

    Hi there
    I am building an application where on a form is a datagridview and textboxes. The dgv and tb are bound to the same table. I am using the dgv to have an overview of the records and the tb I use for editing. Selecting a record programmatically in the dgv is no problem, but the textboxes have to be filled with the same record. Here I have added my code to this far.

    If OuderID <> 0 Then
    'select the row
    For i As Integer = 0 To dgvOuders.RowCount - 1
    If dgvOuders.Rows(i).Cells(0).Value = OuderID Then
    'record found
    dgvOuders.Rows(i).Selected = True
    'now display the record in textboxes
    .....................
    End If
    Next
    End If

    I am stuck right now. I want to add (on the dotted line) an performclick action, but a dgv doesn't have a performclick action. Can somebody help me??
    Thanks a lot!!
    Arneault

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Datagridview and textboxes

    Are the grid and TextBoxes both displayed all the time, or are you opening a dialogue containing the TextBoxes only when you want to edit a record?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    3

    Re: Datagridview and textboxes

    Jmcilhinney, thanks for trying to solve my problem!!
    The textboxes are visible all the time. I dragged them on the form using the datasource.

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