我在 WPF 应用程序中有两个组合框...
在第一个 ComboBox SelectionChanged 事件中,我想清除第二个组合框项目....
private void cmbBoard_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
cmbClass.DataContext = this;
cmbClass.Items.Clear();
CVariables.StrSQLQueryPub = "select ClassID,Class from QB_Class WHERE BoardID='" + strBoardId + "' ORDER BY Class";
CFunctions.fnToFillDataTable(CFunctions.Con, CVariables.StrSQLQueryPub);
DataTable dt = CVariables.DTable;
cmbClass.ItemsSource = dt.DefaultView;
cmbClass.DisplayMemberPath = "Class";
cmbClass.SelectedValuePath = "ClassID";
}