GET SELECTED VALUE OF DATAGRIDVIEWCOMBOBOXCOLUMN

Pravesh Singh

Total Post:101

Points:709
Posted by  Pravesh Singh
C# 
C#
 7475  View(s)
Ratings:
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
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: get selected value of DataGridViewComboBoxColumn

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!