Results 1 to 2 of 2

Thread: populate combobox

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    populate combobox

    I am currently populating a combobox as follows:

    private void PopulateHealthLevels()
    {
    List<clsStudentDetails> healthlevels = new List<clsStudentDetails>();
    healthlevels = clsStudentAccess.GetHealthLevels();
    foreach (clsStudentDetails details in healthlevels)
    {
    cboHealth.Items.Add(details.HealthLevelName);
    }
    }

    Question:
    This is what I have in xaml:
    Name="cboHealth" SelectedIndex="{Binding Path=HealthLevelID}"

    The selectedindex does not seem to be working correctly.
    No matter which student I choose, the item shown is always the same.
    Note that there are items populated in th ecombobox.
    Thanks
    Last edited by arkiboys; Jan 29th, 2011 at 09:35 PM.

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