ArgumentOutOfRangeException: InvalidArgument=Value of 0 is not valid for SelectedIndex

Problem Let’s say you’re initializing a ComboBox like this: And you get the following exception: System.ArgumentOutOfRangeException: ‘InvalidArgument=Value of ‘0’ is not valid for ‘SelectedIndex’. (Parameter ‘value’)Actual value was 0.’ You’re getting this exception because the DataSource is empty. Solution Are you expecting there to always be data? If you’re expecting there to always be data, … Read more ArgumentOutOfRangeException: InvalidArgument=Value of 0 is not valid for SelectedIndex