【发布时间】:2012-10-03 09:09:35
【问题描述】:
我有一个表格,其中有两个组合框和一个网格, 我已经在组合框的 selectedindex 更改事件上编写了过滤代码,为组合框设置了 SuggestAppend 属性。当我输入一个国家名称(例如印度)并按 Enter 时,选定的索引更改事件不会立即触发,当我点击某个地方时它会触发并给出输出。 请建议我该怎么做。在此先感谢
protected void cbCountry_SelectedIndexChanged(object sender, EventArgs e) { 获取条件(); 填充网格(); }
public string GetCondition()
{
string Condition = "";
if (cbEmployee.SelectedIndex > 0)
{
Condition = Condition + " And reg_no=" + cbEmployee.SelectedValue;
}
if (cbCountry.SelectedIndex > 0)
{
Condition = Condition + " And country='" + cbCountry.SelectedItem.Text + "'";
}
return Condition;
}
【问题讨论】:
标签: combobox