How to set selected value of combobox to datagridview cell

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ROSYROSY
    New Member
    • Jan 2012
    • 1

    How to set selected value of combobox to datagridview cell

    Hello friends,

    i have datagridview in my project at fist column as user press enter key ...a combobox shown on that particular column with contain many values ....

    My problem is that ...i want to set selected text of the combobox to that particular cell of the datageidview .....can any budy help me what i have to do


    right now it remains blank

    thanks and regards & sorry for poor english

    rosy
  • Fr33dan
    New Member
    • Oct 2008
    • 57

    #2
    I believe you can use the SelectionStart and SelectionLength in combination with the Text to get the selected value:
    Code:
    dataGridView1[row, column] = comboBox1.Text.Substring(comboBox1.SelectionStart, comboBox1.SelectionLength);

    Comment

    Working...