private void c1TrueDBGrid1_Click(object sender, EventArgs e)
{
}
How can I get the value of a cell and then display it in a textbox.
Just like this code that works for data grid view "OwnerIDtxtbox.Text = PetGrid.Rows[i].Cells[7].Value.ToString();"
c1TrueDBGrid
exposes a couple of indexers that takes the row number as first parameter and the column name or index as the second - you can use either one of them.Please note that both returns
object
.Another option is to use
And of course, you can use the column's string indexer:
For more information, please refer to official documentation.