可能重复:
未绑定数据网格中的路径(wpf)
数据网格中的组合框!!!啊通!
<ComboBox Name="mex" DataContext="{Binding RelativeSource={RelativeSource Self}}" Style="{DynamicResource ComboBoxStyle}" ItemsSource="{Binding Path=combolist}" SelectionChanged="status_SelectionChanged" Height="Auto" Width="Auto">
</ComboBox>
所以
MySqlCommand status_db = new MySqlCommand("select name_ru from request_status", conn);
MySqlDataReader combodata = status_db.ExecuteReader();
List<string> combolist = new List<string>();
while (combodata.Read())
{
combolist.Add(combodata.GetString(0));
}
为什么组合框中的项目为空?我要疯了!!!