我有一个GridView
,里面装有AjaxControlToolkit.ComboBox
控件。
我需要能够在该字段中键入内容,然后按Enter键,然后触发一个事件。目前,我只能在SelectedIndexChanged
上触发一个事件。香港专业教育学院尝试了一些事情,请参阅下文。 (这是将AjaxControlToolkit.ComboBox
添加到GridView
的代码)
ddl.Visible = true;
ddl.ID = "textbox_row_" + temp_row_one_index + "_Cell_" + i + "_";
TableCell cell = new TableCell();
row1.Cells.Add(cell);
if (text == " ")
{
text = "";
}
ddl.Text = text;
ddl.Width = 100;
// ddl.TextChanged
ddl.AutoCompleteMode = AjaxControlToolkit.ComboBoxAutoCompleteMode.Append;
ddl.Items.Add("test1");
ddl.Items.Add("test2");
ddl.Attributes.Add("readonly", "false");
ddl.Attributes.Add("onChanged", "testing(); ");
ddl.Attributes.Add("onBlur", "testing(); ");
ddl.TextChanged += new EventHandler(testing());
ddl.AutoPostBack = true;
ddl.TabIndex = tabindex;
tb.EnableViewState = true;
UpdatePanel up = new UpdatePanel();
up.ContentTemplateContainer.Controls.Add(ddl);
row1.Cells[i].Controls.Add(up);
任何帮助将不胜感激。 :)