T
Trecius
Hello, Newsgroupians:
I have a ListBox that has a .DataSource of an array of Person[]. I am also
using a CurrencyManager to move the position when the Selected_Index of the
ListBox also changes. This works for text boxes and other controls as
follows...
this.TextBox1.DataBindings.Add("Text", lstPeople, "Name");
As you can see, the person's name will populate the textbox.
However, I have a DataGridView that I would like to populate as well. The
first two columns of the DataGridView come from a static dictionary: the key
is the identifier of the task, and the value is the task name. I also want
to add a third column to the DataGridView that comes from the Person
datatype. It will be a boolean value, indicating if the person has
successfully completed the task (True or False).
How can I make it so I that when the Person is changed in the Listbox, the
DataGridView will also change the third, or last, column?
On a short note, I can populate the first two rows, using my dictionary, as
follows:
BindingSource bind = new BindingSource();
bind.DataSource = dictTasks;
GridView1.DataSource = bind;
However, how should I get my last column in there that corresponds to the
Person completing the job or not? Thank you.
Trecius
I have a ListBox that has a .DataSource of an array of Person[]. I am also
using a CurrencyManager to move the position when the Selected_Index of the
ListBox also changes. This works for text boxes and other controls as
follows...
this.TextBox1.DataBindings.Add("Text", lstPeople, "Name");
As you can see, the person's name will populate the textbox.
However, I have a DataGridView that I would like to populate as well. The
first two columns of the DataGridView come from a static dictionary: the key
is the identifier of the task, and the value is the task name. I also want
to add a third column to the DataGridView that comes from the Person
datatype. It will be a boolean value, indicating if the person has
successfully completed the task (True or False).
How can I make it so I that when the Person is changed in the Listbox, the
DataGridView will also change the third, or last, column?
On a short note, I can populate the first two rows, using my dictionary, as
follows:
BindingSource bind = new BindingSource();
bind.DataSource = dictTasks;
GridView1.DataSource = bind;
However, how should I get my last column in there that corresponds to the
Person completing the job or not? Thank you.
Trecius