locked
retrieving a selected value from DataGridViewComboBoxColumn RRS feed

  • Question

  • How do you retrieve a selected value from a DataGridViewComboBoxColumn?

    Thank you,

    Wednesday, January 25, 2006 4:37 PM

Answers

  • I managed this with

    MsgBox("The content of the Combo box is " & Me.DataGridViewTextBoxColumn5.DataGridView.CurrentRow.Cells(0).Value, MsgBoxStyle.OkOnly)

    seems rather a long winded way to get a control value, but I did get there.

    Wednesday, February 8, 2006 5:53 PM

All replies

  • Surely,

     

    String = controlname.text

     

    Monday, February 6, 2006 1:11 PM
  • looking for the same thing.
    i have a datagridview with a combocolumn.
    I need to display the displaymember-value in for example a messagebox. how can this be done?
    Wednesday, February 8, 2006 2:35 PM
  • I managed this with

    MsgBox("The content of the Combo box is " & Me.DataGridViewTextBoxColumn5.DataGridView.CurrentRow.Cells(0).Value, MsgBoxStyle.OkOnly)

    seems rather a long winded way to get a control value, but I did get there.

    Wednesday, February 8, 2006 5:53 PM
  • thank you for the reply, but there is one problem still:

    that solution I've already tried.
    That gets me the selectedvalue from the combobox in the datagridview. I however need the displayvalue from the combobox.

    so, if you have any other suggestions?
    thank you for your time.
    Thursday, February 9, 2006 12:05 PM
  • @stan_v

    I was trying to give a helpful answer to the OP kenia. The OP did ask for the selected value.

    Your request is somewhat different, and you may want to start your own thread detailing what you need instead of hijacking this one and complaining the answer to the original question is not the answer to yours.

    That said, I will play around further and see if I can find a solution for your needs as well.

     

    Sunday, February 12, 2006 12:00 AM
  • please view the page from http://msdn2.microsoft.com/en-us/library/ms404353.aspx. It may help you.
    Wednesday, February 21, 2007 8:32 AM