combobox not displaying text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanea
    New Member
    • Mar 2008
    • 1

    combobox not displaying text

    Hy.

    I have a little problem with a comboBox on my form, and i want to ask if anyone could help me. I'm writing a DB application and i am populating my comboBoxes with an ArrayList object and a DataReader object, like this:

    [CODE=vbnet]
    dataReader = sqlCmd.ExecuteR eader();
    while (dataReader.Rea d())
    {
    arrList.Add(dat aReader["clientName "]);
    }
    clientComboBox. DataSource=arrL ist;
    dataReader.Clos e();
    dataReader = null;
    arrList.RemoveR ange(0, arrList.Count);
    [/CODE]

    My problem is this: the first time i select an option from the comboBox, the selected text is not displayed, but after that, it work fine. How can i fix this?

    Thank you.
    Last edited by debasisdas; Apr 1 '08, 04:54 AM. Reason: added code=vbnet
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Are you setting which value should be initially selected?
    Because it does not look like it.

    Comment

    • kunal pawar
      Contributor
      • Oct 2007
      • 297

      #3
      where is databind method to display text u have to set property of combobox for dataTextField

      Comment

      Working...