I try to get data from text file what I,ve done. And next I want one of column as comboBox. I have no idea how to do that. Should I do it in opposite order? How to put ColumnComboBox in existing DataGridView?
Code to create column ComboBox:
private void FillUslugaComboBoxDataGridView()
{
try
{
StreamReader sr = new StreamReader(@"C:\Users\Radek\Documents\Visual Studio 2010\Projects\Salon Fryzjerski\Salon Fryzjerski\Salon Fryzjerski\Baza\Uslugi.txt");
string line = sr.ReadLine();
DataGridViewComboBoxColumn usluga = new DataGridViewComboBoxColumn();
if (line != null)
{
while (line != null)
{
usluga.Items.Add(line);
line = sr.ReadLine();
}
}
else
{
usluga.Items.Add("Error to fill, column is null");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}