Javascript 组合框所选索引事件未在一次单击中给出输出
我有一个表单,其中有两个组合框和一个网格, 我已经在组合框的selectedindex changed事件上编写了过滤代码,为组合框设置了SuggestAppend属性。当我键入国家名称(如印度)并按enter键时,选定的索引更改事件不会立即触发,当我单击某个位置时,它会触发并给出输出。 请建议我做什么。提前谢谢Javascript 组合框所选索引事件未在一次单击中给出输出,javascript,ajax,Javascript,Ajax,我有一个表单,其中有两个组合框和一个网格, 我已经在组合框的selectedindex changed事件上编写了过滤代码,为组合框设置了SuggestAppend属性。当我键入国家名称(如印度)并按enter键时,选定的索引更改事件不会立即触发,当我单击某个位置时,它会触发并给出输出。 请建议我做什么。提前谢谢 protected void cbCountry_SelectedIndexChanged(object sender, EventArgs e) {
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;
}
网格标记上的
请尝试以下代码
这将确保您在网格中启用键盘导航我使用的是telerik radgrid,telerik中不支持大多数这些属性实际上客户端设置属性是针对telerik的。
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>