GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  ADO.NET 2.0

 Print  |  
Question:  How can we retrieve the value which was selected from a combo box in a datagrid view.

Answer: The grid view consists of 3 columns which are combo Boxes. I want the string in the 1st column.


July 07, 2008 10:25:47 #2
 amitrms   Member Since: July 2008    Total Comments: 1 

RE: How can we retrieve the value which was selected from a combo box in a datagrid view.
 
Use this for fetching the values from combo box

for (int i = 0; i < dataGridView1.Rows.Count; i++)                    {                     if (dataGridView1.Rows[i].Cells[2].Value.ToString() != "Please Select")                        {                           // Write code here;
                         }                                            }

     

 

Back To Question