How To Check If DataGridView Row Is Selected Or Not In C# Windows Application

How To Check If DataGridView Row Is Selected Or Not In C# Windows Application

How To Check If Datagridview Row Is Selected Or Not In C# Windows Application

This tutorial shows how to check whether DataGridView row is selected or not In C# Windows Application

C# SOURCE CODE

            
            //Check if there is atleast one row selected
            if (dataGridView1.SelectedRows.Count > 0 && dataGridView1.SelectedRows != null)
            {
                MessageBox.Show("Row Selected");
            }
            else
            {
                MessageBox.Show("No Row Selected");
            }

Leave a Reply

Your email address will not be published. Required fields are marked *