Results 1 to 8 of 8

Thread: Filling ComboBox using Column property?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Exclamation Filling ComboBox using Column property?

    Is it possible to populate a ComboBox using the Columns property of a dataview? If so how?
    Last edited by seidel1; May 15th, 2005 at 11:28 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Filling ComboBox using Column property?

    Do you mean the column name?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Re: Filling ComboBox using Column property?

    Yes, Column Name

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Re: Filling ComboBox using Column property?

    Any recommendations on this?

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Filling ComboBox using Column property?

    Sorry, missed out on this one earlier. I don't have the IDE open, but try looking for a columns collection's .Name property. If not in a dataview, it should exist in a dataset.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Re: Filling ComboBox using Column property?

    Thanks Mendhak, I am making progress, but still missing one piece (I think)

    Here's what I HAD
    'cboFieldName.Items.Add("Student ID")
    'cboFieldName.Items.Add("First Name")
    'cboFieldName.Items.Add("Last Name")
    'cboFieldName.Items.Add("Account Balance")
    'cboFieldName.Items.Add("Employee")

    Here's what I want...
    cboFieldName.DataSource = m_dsStudents.Tables("Students")
    cboFieldName.DisplayMember = "what goes here"

    'From what I read the display member is looking for text. I want to pull the column headings. Any ideas?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Re: Filling ComboBox using Column property?

    any ideas?

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Exclamation Filling ComboBox using Column property?

    I have made some progress using:

    For intIndex As Integer = 0 To m_dvStudents.Table.Columns.Count - 1
    cboFieldName.Items.Add(m_dvStudents.Table.Columns(intIndex).ColumnName)
    Next intIndex

    But how do I use the "Value" of the Column vs the index?

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