Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

The easiest way is through a Forms BindingContext property. If you've bound your textbox like so:

// Text is the property on the TextBox control
// FirstName is a column in the DataTable Table1
textBox1.DataBindings.Add("Text", myDataSet.Tables["Table1"], "FirstName");

 

Then you can navigate forward/backwards like so:

this.BindingContext[myDataSet.Tables["Table1"]].Position++;

 

You can also create your own CurrencyManager, as Robby suggested. Especially if you need multiple "pointers" into the same DataTable.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

plus you have to change "++" to "+=1" or "-=1" depending on the direction you want to navigate to.

 

And yes Robby the CurrencyManager is a great deal.

It's worth a second and third glance.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...