2010-11-24 4 views
0

Я заполняю combobox так. хочу, чтобы был флирт. как я могу это сделать?Первые значения combobox должны быть пустыми

private void txtLoadname_DropDown(object sender, EventArgs e) 
    { 
     HashSet<string> LoadName = new HashSet<string>(); 
     for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) 
     { 
      LoadName.Add(dataGridView1.Rows[i].Cells["loadNameDataGridViewTextBoxColumn"].Value.ToString()); 
     } 
     txtLoadname.DataSource = LoadName.ToList(); 


    } 
+0

Почему я могу спросить? – Vishal 2010-11-24 18:01:33

ответ

1

Попробуйте добавить LoadName.Add (null); перед циклом.

+0

thaanks его работы отлично (обнять) – 2010-11-24 18:21:56

1

добавить эту строку как раз перед последней строкой:

LoadName.InsertAt(0,"");