how to do indexing? I enter a number in the textbox and retrieve the data, not the index currently only reads the index
my code :
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
int columnindex = dataGridView1.CurrentRow.Index;
if (dataGridView1.Rows[i].Cells[0].Value.ToString() == textBox1.Text)
{
dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[0];
dataGridView1.Rows[i].Selected = true;
dataGridView1.Rows[i].Frozen.ToString();
}
var diction = Convert.ToInt32(textBox2.Text.ToString());
Dictionary<int, string> Parameters = new Dictionary<int, string>();
{
Parameters.Add(1, "0");
Parameters.Add(2, "0,5");
Parameters.Add(3, "1");
}
textBox3.Text = dataGridView1.Rows[cellindex].Cells[diction].Value.ToString();
}
error: System.FormatException: 'Input string was not in a correct format.'