Home > DeveloperSection > Forums > Get selected value of DataGridViewComboBoxColumn
Pravesh Singh
Pravesh Singh

Total Post:101

Points:709
Posted on    January-05-2013 4:01 AM

 C# C# 
Ratings:


 1 Reply(s)
 6031  View(s)
Rate this:
Hi 

I have used DataGridViewComboBoxColumn in my datagridview in windows application form, but i can not get selected value. I want to insert selected data into database table. can you help me?

Thanks


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    January-05-2013 7:19 AM

Hi Pravesh Singh

You can try this code
private void dgvDeveloperSection_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
      string sWeek = dgvDeveloperSection.Rows[e.RowIndex].Cells[0].Value.ToString();
 }

Note: .Rows[e.RowIndex].Cells[0] is the index of ComboBox Column.

I hope this solve your problem

Don't want to miss updates? Please click the below button!

Follow MindStick