ta mu

ta mu

  • NA
  • 201
  • 81.8k

selected row index

Sep 8 2013 1:50 AM
i am trying to get selected row index but i got error

 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            MessageBox.Show(dataGridView1.SelectedRows[0].Index.ToString());
        }



Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index


whats wrong

Answers (1)