i've got a problem while trying to get some values through the DataGridViewRow. the problem is my cell index is 7 and when i try to get the data from the cell using this code:
foreach (DataGridViewRow r in this.mydatagrid.Rows)
{
if (Convert.ToBoolean(r.Cells[0].Value) == true)
{
DataGridViewComboBoxCell cc = (DataGridViewComboBoxCell)r.Cells[7];
cc.Value = toolStripComboBox1.SelectedItem.ToString();
edit_subject(Convert.ToInt32(r.Cells[1].Value), r.Cells[7].Value.ToString());
}
an Exception Error Comes Saying That Cells[7] is OutOfIndex . so i've tried to change the cell index from 7 to 5 and it's worked sometimes , and sometimes no .
please i need explain because it's really weird.