Need help IF DATAGRID NO HAVE VALUES TEXTBOX EMPTY
Thank you
- private void testDataGridView_SelectionChanged(object sender, EventArgs e)
- {
- if (testDataGridView.SelectedRows.Count > 0)
- {
- string test = testDataGridView.SelectedRows[0].Cells["columnname"].Value.ToString();
- testTextBox.Text = test;
- }
- }

Gajendra JangidRank #157 · 14.9K reputationPosted Mar 24, 2019, 8:50 PM EDT
you want to say that, if your datagrid does not have any row then your textbox will empty: