{"id":258253,"date":"2024-07-05T16:33:38","date_gmt":"2024-07-05T16:33:38","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=258253"},"modified":"2024-07-05T16:33:38","modified_gmt":"2024-07-05T16:33:38","slug":"how-to-get-selected-cell-value-from-datagridview-in-c","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/","title":{"rendered":"How to get selected cell value from DataGridView in C#?"},"content":{"rendered":"<p>The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like sorting, filtering, and editing. One common requirement is to retrieve the value of the selected cell from the DataGridView control. In this article, we will explore different ways to achieve this.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#1_Using_the_SelectedCells_property\" title=\"1. Using the SelectedCells property\">1. Using the SelectedCells property<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#2_Using_the_CurrentCell_property\" title=\"2. Using the CurrentCell property\">2. Using the CurrentCell property<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#3_Handling_the_CellClick_event\" title=\"3. Handling the CellClick event\">3. Handling the CellClick event<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#4_Handling_the_CellContentClick_event\" title=\"4. Handling the CellContentClick event\">4. Handling the CellContentClick event<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#5_Handling_the_SelectionChanged_event\" title=\"5. Handling the SelectionChanged event\">5. Handling the SelectionChanged event<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#FAQs\" title=\"FAQs:\">FAQs:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q1_Can_I_get_the_value_of_a_specific_cell_in_the_DataGridView\" title=\"Q1. Can I get the value of a specific cell in the DataGridView?\">Q1. Can I get the value of a specific cell in the DataGridView?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q2_How_can_I_get_the_value_of_a_specific_cell_by_row_and_column_index\" title=\"Q2. How can I get the value of a specific cell by row and column index?\">Q2. How can I get the value of a specific cell by row and column index?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q3_Can_I_get_the_value_of_a_cell_in_a_different_column_or_row\" title=\"Q3. Can I get the value of a cell in a different column or row?\">Q3. Can I get the value of a cell in a different column or row?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q4_What_if_no_cell_is_selected_in_the_DataGridView\" title=\"Q4. What if no cell is selected in the DataGridView?\">Q4. What if no cell is selected in the DataGridView?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q5_How_can_I_retrieve_the_value_of_the_selected_cell_in_a_different_data_type\" title=\"Q5. How can I retrieve the value of the selected cell in a different data type?\">Q5. How can I retrieve the value of the selected cell in a different data type?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q6_Is_it_possible_to_get_the_value_of_a_cell_in_an_unbound_DataGridView\" title=\"Q6. Is it possible to get the value of a cell in an unbound DataGridView?\">Q6. Is it possible to get the value of a cell in an unbound DataGridView?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q7_Can_I_get_the_value_of_a_cell_that_is_in_edit_mode\" title=\"Q7. Can I get the value of a cell that is in edit mode?\">Q7. Can I get the value of a cell that is in edit mode?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q8_How_can_I_get_the_value_of_a_cell_in_a_different_column\" title=\"Q8. How can I get the value of a cell in a different column?\">Q8. How can I get the value of a cell in a different column?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q9_How_can_I_get_the_value_of_a_cell_in_a_different_row\" title=\"Q9. How can I get the value of a cell in a different row?\">Q9. How can I get the value of a cell in a different row?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q10_Can_I_get_the_value_of_a_cell_in_a_hidden_column\" title=\"Q10. Can I get the value of a cell in a hidden column?\">Q10. Can I get the value of a cell in a hidden column?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q11_Is_it_possible_to_get_the_value_of_a_cell_in_a_read-only_DataGridView\" title=\"Q11. Is it possible to get the value of a cell in a read-only DataGridView?\">Q11. Is it possible to get the value of a cell in a read-only DataGridView?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#Q12_How_can_I_get_the_value_of_a_cell_in_a_different_sheet_of_a_DataGridView\" title=\"Q12. How can I get the value of a cell in a different sheet of a DataGridView?\">Q12. How can I get the value of a cell in a different sheet of a DataGridView?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Using_the_SelectedCells_property\"><\/span>1. Using the SelectedCells property<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>SelectedCells<\/strong> property of the DataGridView control provides access to a collection of selected cells. To retrieve the value of the selected cell, you can use the following code:<\/p>\n<p><code><br \/>\nDataGridViewCell selectedCell = dataGridView1.SelectedCells[0];<br \/>\nstring cellValue = selectedCell.Value.ToString();<br \/>\n<\/code><\/p>\n<p>This code retrieves the first cell from the collection of selected cells and converts its value to a string using the <strong>ToString()<\/strong> method.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Using_the_CurrentCell_property\"><\/span>2. Using the CurrentCell property<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>CurrentCell<\/strong> property of the DataGridView control represents the currently selected cell. You can retrieve the value of the selected cell using the following code:<\/p>\n<p><code><br \/>\nDataGridViewCell selectedCell = dataGridView1.CurrentCell;<br \/>\nstring cellValue = selectedCell.Value.ToString();<br \/>\n<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Handling_the_CellClick_event\"><\/span>3. Handling the CellClick event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>CellClick<\/strong> event of the DataGridView control is raised when a cell is clicked. You can handle this event to retrieve the value of the clicked cell:<\/p>\n<p><code><br \/>\nprivate void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)<br \/>\n{<br \/>\n    if (e.RowIndex >= 0 && e.ColumnIndex >= 0)<br \/>\n    {<br \/>\n        DataGridViewCell selectedCell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];<br \/>\n        string cellValue = selectedCell.Value.ToString();<br \/>\n    }<br \/>\n}<br \/>\n<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Handling_the_CellContentClick_event\"><\/span>4. Handling the CellContentClick event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>CellContentClick<\/strong> event of the DataGridView control is raised when the content of a cell is clicked. You can retrieve the value of the clicked cell using a similar approach as the CellClick event:<\/p>\n<p><code><br \/>\nprivate void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)<br \/>\n{<br \/>\n    if (e.RowIndex >= 0 && e.ColumnIndex >= 0)<br \/>\n    {<br \/>\n        DataGridViewCell selectedCell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];<br \/>\n        string cellValue = selectedCell.Value.ToString();<br \/>\n    }<br \/>\n}<br \/>\n<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_Handling_the_SelectionChanged_event\"><\/span>5. Handling the SelectionChanged event<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>SelectionChanged<\/strong> event of the DataGridView control is raised when the selection changes. You can retrieve the value of the selected cell using the CurrentCell property:<\/p>\n<p><code><br \/>\nprivate void dataGridView1_SelectionChanged(object sender, EventArgs e)<br \/>\n{<br \/>\n    if (dataGridView1.CurrentCell != null)<br \/>\n    {<br \/>\n        DataGridViewCell selectedCell = dataGridView1.CurrentCell;<br \/>\n        string cellValue = selectedCell.Value.ToString();<br \/>\n    }<br \/>\n}<br \/>\n<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"Q1_Can_I_get_the_value_of_a_specific_cell_in_the_DataGridView\"><\/span>Q1. Can I get the value of a specific cell in the DataGridView?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can access a specific cell in the DataGridView by specifying the row and column index.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q2_How_can_I_get_the_value_of_a_specific_cell_by_row_and_column_index\"><\/span>Q2. How can I get the value of a specific cell by row and column index?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>You can use the Rows and Cells properties of the DataGridView to access a specific cell by its row and column index.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q3_Can_I_get_the_value_of_a_cell_in_a_different_column_or_row\"><\/span>Q3. Can I get the value of a cell in a different column or row?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can specify a different row and column index to retrieve the value of a cell in a specific location.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q4_What_if_no_cell_is_selected_in_the_DataGridView\"><\/span>Q4. What if no cell is selected in the DataGridView?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>If no cell is selected, you should handle this case in your code to avoid null reference exceptions.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q5_How_can_I_retrieve_the_value_of_the_selected_cell_in_a_different_data_type\"><\/span>Q5. How can I retrieve the value of the selected cell in a different data type?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>You can convert the value of the selected cell to a different data type using conversion methods like <strong>int.Parse()<\/strong> or <strong>Convert.ToInt32()<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q6_Is_it_possible_to_get_the_value_of_a_cell_in_an_unbound_DataGridView\"><\/span>Q6. Is it possible to get the value of a cell in an unbound DataGridView?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>No, unbound DataGridView controls do not have cell values associated with them. They are typically used to display data from custom data sources.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q7_Can_I_get_the_value_of_a_cell_that_is_in_edit_mode\"><\/span>Q7. Can I get the value of a cell that is in edit mode?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can retrieve the value of a cell that is currently being edited using the <strong>EditingControl<\/strong> property of the DataGridView.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q8_How_can_I_get_the_value_of_a_cell_in_a_different_column\"><\/span>Q8. How can I get the value of a cell in a different column?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>You can access the value of a cell in a different column by specifying the column index instead of using the CurrentCell property.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q9_How_can_I_get_the_value_of_a_cell_in_a_different_row\"><\/span>Q9. How can I get the value of a cell in a different row?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>You can access the value of a cell in a different row by using the Rows property of the DataGridView and specifying the row index.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q10_Can_I_get_the_value_of_a_cell_in_a_hidden_column\"><\/span>Q10. Can I get the value of a cell in a hidden column?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can retrieve the value of a cell in a hidden column using the Cells property of the DataGridView and specifying the column index.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q11_Is_it_possible_to_get_the_value_of_a_cell_in_a_read-only_DataGridView\"><\/span>Q11. Is it possible to get the value of a cell in a read-only DataGridView?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can still retrieve the value of a cell in a read-only DataGridView using the SelectedCells or CurrentCell property.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q12_How_can_I_get_the_value_of_a_cell_in_a_different_sheet_of_a_DataGridView\"><\/span>Q12. How can I get the value of a cell in a different sheet of a DataGridView?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>The DataGridView control does not have built-in support for multiple sheets. If you have multiple sheets, you&#8217;ll need to handle the logic manually to switch between sheets and retrieve the values accordingly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like sorting, filtering, and editing. One common requirement is to retrieve the value of the selected cell from the DataGridView control. In this article, we will explore different ways to achieve this. 1. Using &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to get selected cell value from DataGridView in C#?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#more-258253\">Read more<span class=\"screen-reader-text\">How to get selected cell value from DataGridView in C#?<\/span><\/a><\/p>\n","protected":false},"author":65,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-258253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get selected cell value from DataGridView in C#?<\/title>\n<meta name=\"description\" content=\"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get selected cell value from DataGridView in C#?\" \/>\n<meta property=\"og:description\" content=\"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-05T16:33:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Timothy Mathis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Timothy Mathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\"},\"author\":{\"name\":\"Timothy Mathis\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\"},\"headline\":\"How to get selected cell value from DataGridView in C#?\",\"datePublished\":\"2024-07-05T16:33:38+00:00\",\"dateModified\":\"2024-07-05T16:33:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\"},\"wordCount\":690,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\",\"name\":\"How to get selected cell value from DataGridView in C#?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-07-05T16:33:38+00:00\",\"dateModified\":\"2024-07-05T16:33:38+00:00\",\"description\":\"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get selected cell value from DataGridView in C#?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318\",\"name\":\"Timothy Mathis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Timothy Mathis\"},\"description\":\"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get selected cell value from DataGridView in C#?","description":"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/","og_locale":"en_US","og_type":"article","og_title":"How to get selected cell value from DataGridView in C#?","og_description":"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like","og_url":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-07-05T16:33:38+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png","type":"image\/png"}],"author":"Timothy Mathis","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Timothy Mathis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/"},"author":{"name":"Timothy Mathis","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318"},"headline":"How to get selected cell value from DataGridView in C#?","datePublished":"2024-07-05T16:33:38+00:00","dateModified":"2024-07-05T16:33:38+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/"},"wordCount":690,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/","url":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/","name":"How to get selected cell value from DataGridView in C#?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-07-05T16:33:38+00:00","dateModified":"2024-07-05T16:33:38+00:00","description":"The DataGridView control is a commonly used control in C# Windows Forms applications for displaying tabular data. It provides powerful features like","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-selected-cell-value-from-datagridview-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to get selected cell value from DataGridView in C#?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/ffa5be155490b2344e28f672fcc1e318","name":"Timothy Mathis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Timothy Mathis"},"description":"Guest author Timothy Mathis has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/258253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=258253"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/258253\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=258253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=258253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=258253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}