Results 1 to 3 of 3

Thread: Binding DataGrid..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    Binding DataGrid..

    I use this code on the Search button of the frmGrid to filter all the records with the same position.

    Dim aFind As String = InputBox("Enter a Position", "Filter Employees Position")
    'Filter
    DataSet11.Employee.DefaultView.RowFilter = "empposition like '" & aFind & "%'"
    DataGrid1.DataSource = DataSet11.Employee

    On the Input Box I type: "Clerk" and all records with this position display.
    But if want to navigate records using "<<" and ">>" doesn't work. Try to see the file attached with this thread for you to understand this.
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    I tried downloading your zip file and didn't want to open. However back to basics, remember a datagrid only reflects the underlying data in your dataset. Navigating the data means moving the Datarow pointer up and down. Therefore to move forward one, set your datarow value +1, move it back set it it value -1.

    The current value will reflect the data it is on.

    I feel sure there is a sample program prvided to do just that, check that area in Visual Studio.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441
    I re-attached the file again. I try to do what you have said I don't if is the right way. Much better if you're goind to see Project of mine.
    Attached Files Attached Files

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