组合框选择索引事件一次单击不提供输出

时间:2012-10-01 13:20:31

标签: javascript ajax

我有一个表单,其中有两个组合框和一个网格, 我已经在selectedindex改变了组合框的事件上写了过滤代码,为组合框设置了SuggestAppend属性。当我输入一个国家名称,例如印度,然后按回车键,所选索引改变的事件不会立即触发,当我点击某处时,它的火灾并给出输出。   请建议我做什么。谢谢你提前

  protected void cbCountry_SelectedIndexChanged(object sender, EventArgs e)
        {
            GetCondition();
            Fillgrid();
        }

     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;
            }

1 个答案:

答案 0 :(得分:0)

on the grid tag

<Grid>

try the following code

    <ClientSettings AllowKeyboardNavigation="true" 
                KeyboardNavigationSettings-AllowSubmitOnEnter="true"
                KeyboardNavigationSettings-AllowActiveRowCycle="true" 
                KeyboardNavigationSettings-CollapseDetailTableKey="LeftArrow"
                KeyboardNavigationSettings-ExpandDetailTableKey="RightArrow">

            </ClientSettings>




</Grid>

这将确保您在网格中启用键盘导航