问题:
怎样读出Combobox中当前选中项的text,此combobox 可填写,也可选择,怎样获取到用户输入的或选择的文本呢?此combobox有动态数据源绑定
方法:
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{DataTable dt=ds.Tables[ "tablename "];
DataColumn dc =(DataColumn)dt.Columns[ "columnname "];
DataRowView dr=(DataRowView)this.comboBox1.SelectedItem;
string select = dr.Row[dc].ToString();
}
ds是你自己设置的DATASET
5万+

被折叠的 条评论
为什么被折叠?



