Loop through Controls?

P

Phill

I have a form with several textboxes, checkboxes, and
comboboxes that I want to dynamically databind to a
column in the DataRow being passed in when the form is
intantiated. I have named the fields the same as the
column names that will hold the values. I am stuck.
This is what I have so far. Please help.

public AddPatientForm(DataRow PatientRecord )
{
InitializeComponent();

//Fill with current record
foreach(Control MyControl in this.Controls)
{
//this.FirstName.DataBindings.Add
("Text",PatientRecord[1],null);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top