I want to know if there is a way to set index of ComboBox that is already in DataGridView column. I don't want to add new Column and/or Remove existing one.
Let's say I have four columns (e.g. Employee Info) in DataGridView as:
ID | Name | Address | Job
Now, Job attribute is of type ComboBox has some known and valid values. I have tried via DataTable and DataGridViewComboBoxCell methods but didn't work as required.
What should be done at this point? Here is the code:
dtGridView.Rows.Add();
dtGridView.Rows[row].Cells["ID"].Value = ID;
dtGridView.Rows[row].Cells["Name"].Value = Name;
dtGridView.Rows[row].Cells["Address"].Value = Address;
// Below Line doesn't work
dtGridView.Rows[row].Cells["Job"].Value = ????????
Keep in mind that dtGridView is Read-Only and value must be assigned via code i.e. set Index of ComboBox.