I have many List:
List<int> list1 = new List<int>(){ 1, 2, 3};
List<int> list2 = new List<int>(){ 1, 2};
List<int> list3 = new List<int>(){ 1, 2, 3, 4};
And I have this code:
foreach (Subtipo STC in lista.Subtipos)
{
dataGridViewTiposConsulta.Rows[index].Cells[6] as DataGridViewComboBoxCell).DataSource = STC.active ? list1 : list2;
}
When i execute the program, it work fine. But when a change de selected item in combobox cell the value that is show is always the first in the list of datasource.
Why? Thanks