Property or indexer 'System.Windows.Forms.DataGridViewBand.Index' cannot be assigned to -- it is read only - C#
Формулировка задачи:
Работаю с DataGridView, при попытке изменить Index у строки выдает ошибку:
Код:
Ошибка указывает на :
Property or indexer 'System.Windows.Forms.DataGridViewBand.Index' cannot be assigned to -- it is read only
int a = launcherview.CurrentRow.Index;
if (launcherview.Rows[a].Cells[3].Selected)
{
launcherview.CurrentRow.Index = launcherview.CurrentRow.Index + 1;
}launcherview.CurrentRow.Index
. Как избежать ошибку?Решение задачи: «Property or indexer 'System.Windows.Forms.DataGridViewBand.Index' cannot be assigned to -- it is read only»
textual
Листинг программы
launcherview.Rows[index].Selected = true;