Moving through bound records on a form

  • 14 years ago
    Hi there

    I would like my bound form to move through the records at the press of a button.

    I have successfully bound the form controls to the dataset. I have drawn two buttons on to the form to move forwards and backwards one through the records. Here is the code I am using to move forwards:

    this.BindingContext[this.dstDataset.tblTransactions].Position++;

    Although I know there is more than one record in the dataset, nothing changes on the form when I press these buttons.

    Do I need to do something else to get the form to show me the next record, maybe refresh the form in some way?

    Thanks for your help













  • 14 years ago

    Try using currency manager, the code should look something like this:

    CuurrencyManager cm = this.BindingContext[this.dstDataset.tblTransactions]

    cm.Position = cm.Position + 1

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook