CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Posts
    40

    Exclamation window form's combo box

    I am using the combobox in a window form and datasource property of that is the arraylist.
    Now when the arraylist changes the combobox shows the new arraylist items in the dropdown but the selected item is that of the previous one.
    i use the datasource property set to null before binding it and also tryed the refresh() and the invalidate() but these are not working.

    the code are as:

    Combobox1.datasource=null;
    Combobox1.datasource=arraylist1;

    can anyone help me.

    Thnx in advance.

  2. #2
    Join Date
    Mar 2006
    Location
    Graz, Austria
    Posts
    273

    Re: window form's combo box

    please show how you change the arrayList
    Daniela
    ******
    I would love to change the world, but they won't give me the source code

  3. #3
    Join Date
    Jan 2007
    Posts
    40

    Exclamation Re: window form's combo box

    the arraylist are the variable and the arraylist are fill by the xml file which is declare in another class on the values of the xml the arrayliast are fill.

  4. #4
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: window form's combo box

    reset the selectedindex property to -1 before changing the datasource, this way the previously selected item will not be shown

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

Featured