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;

ИИ для рефератов и докладов


  • Экспорт Word по ГОСТу
  • Минимум 80% уникальности текста
  • Поиск релевантных источников в интернете
  • Готовый документ за 2 минуты

Оцени полезность:

8   голосов , оценка 4.125 из 5
Похожие ответы