I got the information, using the DataGridViewComboBoxCell.DataSource instade of DataGridViewComboBoxColumn.DataSource will solve the problem.
public partial class Form1 : Form
{
DataGridViewComboBoxColumn column;
DataGridViewComboBoxCell cell;
DataTable dataTable1 = new DataTable("Syria");
DataTable dataTable2 = new DataTable("Yemen");
public Form1()
{
InitializeComponent();
column = new DataGridViewComboBoxColumn();
dataTable1.Columns.Add("Code", typeof(String));
dataTable1.Columns.Add("Cities", typeof(String));
dataTable1.Rows.Add("1", "Damascus");
dataTable1.Rows.Add("11", "Azaz");
dataTable1.Rows.Add("111", "Aleppo");
dataTable2.Columns.Add("Code", typeof(String));
dataTable2.Columns.Add("Cities", typeof(String));
dataTable2.Rows.Add("2", "Sanaa");
dataTable2.Rows.Add("22", "Aden");
dataGridView1.Columns.Add(column);
cell = (DataGridViewComboBoxCell)dataGridView1.Rows[0].Cells[1];
cell.DataSource = dataTable1;
cell.ValueMember = "Code";
cell.DisplayMember = "Cities";
column.CellTemplate = cell;
}
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
cell =(DataGridViewComboBoxCell) dataGridView1.Rows[e.RowIndex].Cells[column.Name.ToString()];
if (e.ColumnIndex==0)
{
if(dataGridView1.CurrentCell.Value.ToString()== "Syria")
{
cell.DataSource = dataTable1;
}
else if(dataGridView1.CurrentCell.Value.ToString() == "Yemen")
{
cell.DataSource = dataTable2;
}
}
}
}
}