×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Bind DataRepeater at Runtime for Windows Forms

Bind DataRepeater at Runtime for Windows Forms

Bind DataRepeater at Runtime for Windows Forms

(OP)
OK, this is driving me crazy.
I Can't seem to get a data repeater to show data when I bind at runtime to either a data table or a binding source.
The repeater shows the correct number of rows, just no data.
I checked the data is there in the table.
Seems like this should be easy, I must be missing something simple.
I have it working setting up all of the binding at design time, but can't seem to get it to work at runtime.
I have tried the following, with and without virtual mode.
Please help!

CODE

'This code is in the load of the form.
myDt = SelectRouting() 'SQL Proc
myBs = New BindingSource
myBs.DataSource = myDt
myBs.Sort = "prorefint, seqno"

txtVendName.DataBindings.Add("Text", myBs, "VendName")
DataRepeater2.DataSource = myBs

' OR
txtVendName.DataBindings.Add("Text", myDt, "VendName")
DataRepeater2.DataSource = myDt 

Auguy
Sylvania/Toledo Ohio

RE: Bind DataRepeater at Runtime for Windows Forms

What does SelectRouting do? I don't see any code for that. Maybe the problem could be located to that.

RE: Bind DataRepeater at Runtime for Windows Forms

(OP)
Forgot about this post, but thanks for responding.

CODE

SelectRouting() 
is just a procedure to retrieve some data from the database.

I got it to work with setting the data binding of the textboxes at design time but wanted to do it at run time.
Not sure what I was doing wrong before but this seems to work now and not setting the data repeater binding source.

CODE

txtVendName.DataBindings.Add("Text", myBs, "VendName") 

Auguy
Sylvania/Toledo Ohio

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close