---
title: "C# datagridview full row selection but get single cell value"  
description: "C# datagridview full row selection but get single cell value"  
author: "Anonymous User"  
published: 2013-10-04  
updated: 2013-10-04  
canonical: https://www.mindstick.com/forum/1583/c-sharp-datagridview-full-row-selection-but-get-single-cell-value  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# C# datagridview full row selection but get single cell value

I have a [datagridview](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp) that is a [full](https://www.mindstick.com/articles/12893/experience-the-full-power-of-suitecrm) row select. How would I grab the [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) from only a certain cell no matter what cell in the row was clicked on since it highlights the [entire row](https://answers.mindstick.com/qa/46828/if-i-buy-an-entire-row-of-seats-on-a-long-flight-so-no-one-is-next-to-me-can-the-airline-sell-one-of-my-empty-seats-to-someone-or-will-they-respect-the-fact-that-the-empty-seats-are-mine-to-do-as-i-p).

## Replies

### Reply by Anonymous User

You can do like this......

```
     private void datagridview1_SelectionChanged(object sender, EventArgs e)
     {
         if (datagridview1.SelectedCells.Count > 0)
         {
             int selectedrowindex = datagridview1.SelectedCells[0].RowIndex;
             DataGridViewRow selectedRow = datagridview1.Rows[selectedrowindex];
              string a = Convert.ToString(selectedRow.Cells["you have to mention you cell  corresponding column name"].Value);
         }
     }
```


---

Original Source: https://www.mindstick.com/forum/1583/c-sharp-datagridview-full-row-selection-but-get-single-cell-value

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
