Home Forums WinForms controls Other WinForms controls Wincombobox Selected Value

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18342 |

    Currently using :
    wcbHS.SelectedItem = wcbHS.Items(dr(9))

    Using this to load the values :

    With wcbHS
    .DataSource = Globals.dsDD.Tables(“tblHS”)
    .DisplayFormat = “%DISPLAY%”
    .Columns(“VALUE”).Visible = False
    .Columns(“ABR”).Visible = False
    .ValueMember = “VALUE”
    End With

    Currently it’s pulling, for example if dr(9) = 3, the third row. I need this to default the displayed value to the row where the value for VALUE=3

    Any help would be much appriciated

    Imported from legacy forums. Posted by Ooh (had 3882 views)

    User (Old forums)
    Member
    Post count: 23064

    Use the SelectedValue property instead of the SelectedItem property.

    e.g.:

    wcbHS.SelectedValue= wcbHS.Items(dr(9))

    Imported from legacy forums. Posted by André (had 310 views)

    User (Old forums)
    Member
    Post count: 23064

    When I use that. It errors out on me. Doesn’t give me an error but on my output it displays

    A first chance exception of type ‘System.ArgumentException’ occurred in mscorlib.dll

    Imported from legacy forums. Posted by Ooh (had 346 views)

    Xceed Support
    Member
    Post count: 5658

    Is the debugger set to break on all exceptions? (Debug Menu -> Exceptions -> Common Language Runtime Exception, then select “Break into the debugger” radio button in VS2003, or select “Thrown” CheckBox in VS2005).

    If you are in VS2005, make sure the “Enable Just My Code” CheckBox is unselected (Tools Menu -> Options -> Debugging -> General).

    This will make sure that no exceptions are swallowed by the grid, and that the debugger will break in any part of the code, not just yours.

    Imported from legacy forums. Posted by CharlesB (had 4633 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.