Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void dgvSavedSearchQueries_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex == 0 && ((DataGridView)sender).Columns[e.ColumnIndex].GetType() == typeof(DataGridViewButtonColumn))
            {
               

            }

        }

how can i code inside if condition to get data of that row and column ?
Posted

For getting data of a column in the row use
C#
var data = dgvSavedSearchQueries.Rows[e.RowIndex].Cells[0].Value.ToString();
 
Share this answer
 
Try...
C#
MessageBox.Show(dgvSavedSearchQueries.CurrentCell.Value.ToString());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900