Results 1 to 2 of 2

Thread: [RESOLVED] Datagridview with unbound combobox columns

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Resolved [RESOLVED] Datagridview with unbound combobox columns

    Hello

    I am working with an Unbound DataGridView. I would like to vary the contents of a second combobox based on what is selected in the first. I have code to add the columns and populate the first combobox, but I can't figure out how to do the second one since it can (and usually will) have a different list for each row AND the list must change when the selection in the first is changed.

    The code I have so far has already been posted.

    Like I said,m I wish to use this grid unbound, if someone has a bound solution, please post that, I may be able to deduce how to do it unbound based on that.

    Any links or unbound tutorials would be appreciated also. I have searched and searched, but found very little.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Datagridview with unbound combobox columns

    I got it after hours of searching. Here is the solution :
    Code:
                        dgvFields.Rows.Add(strFieldRow)
                        cmbCell = New DataGridViewComboBoxCell
                        Fill(cmbCell, strCriteria)
                        dgvFields.Rows(dgvFields.Rows.Count - 1).Cells(eGridFieldColumns.KeyField) = cmbCell
                        dgvFields.Rows(dgvFields.Rows.Count - 1).Cells(eGridFieldColumns.KeyField).Value = .FKeyParentField
    
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width