Thanks.
i tried one more ideas.
I have added different list item to map the combo box cell. it's also working.
Example
List<string> Emplist1 = new List<string>();
List<string> Emplist2 = new List<string>();
foreach (DataRow row in dt.Rows)
{
Grid1.Rows.Add();
Grid1[0, cnt].Value = row["EmpNO"].ToString();
Grid1.UpdateCellValue(0, cnt);
DataGridViewComboBoxCell cbobox = (DataGridViewComboBoxCell)Grid1[1, cnt];
if (cbobox.Items.Count == 0)
{
// Conditions
if ((Mark1 != 0) && (SUB == "H1"))
{
Emplist.Clear();
Emplist.Add("1-EXCELLENT");
Emplist.Add("2-MODERATE");
cbobox.DataSource = Emplist1;
Grid1.UpdateCellValue(3, cnt);
}
else if ((Mark2 != 0) && (SUB2 == "H2"))
{
Emplist.Clear();
Emplist.Add("1-EXCELLENT");
Emplist.Add("2-MODERATE");
Emplist.Add("3-GOOD");
Emplist.Add("3-AVERAGE");
cbobox.DataSource = Emplist2;
Grid1.UpdateCellValue(3, cnt);
}
}
Grid1.UpdateCellValue(1,cnt);
Grid1.Refresh();
cnt++;
}
This is also working and simple